Fix oauth name autofill for registration

This commit is contained in:
Igor Scheller 2024-03-23 00:01:54 +01:00 committed by xuwhite
parent 541789ae27
commit f9059161ec
2 changed files with 6 additions and 6 deletions

View File

@ -309,8 +309,8 @@ class OAuthController extends BaseController
$this->session->set('form-data-username', $userdata->get($config['username']));
$this->session->set('form-data-email', $userdata->get($config['email']));
$this->session->set('form-data-first_name', $userdata->get($config['first_name']));
$this->session->set('form-data-last_name', $userdata->get($config['last_name']));
$this->session->set('form-data-firstname', $userdata->get($config['first_name']));
$this->session->set('form-data-lastname', $userdata->get($config['last_name']));
$this->session->set('oauth2_groups', $userdata->get($config['groups'], []));
$this->session->set('oauth2_connect_provider', $providerName);

View File

@ -461,8 +461,8 @@ class OAuthControllerTest extends TestCase
$this->assertEquals(null, $this->session->get('oauth2_allow_registration'));
$this->assertEquals($this->session->get('form-data-username'), 'username');
$this->assertEquals($this->session->get('form-data-email'), 'foo.bar@localhost');
$this->assertEquals($this->session->get('form-data-first_name'), 'Foo');
$this->assertEquals($this->session->get('form-data-last_name'), 'Bar');
$this->assertEquals($this->session->get('form-data-firstname'), 'Foo');
$this->assertEquals($this->session->get('form-data-lastname'), 'Bar');
$this->config->set('registration_enabled', false);
$this->expectException(HttpNotFound::class);
@ -541,8 +541,8 @@ class OAuthControllerTest extends TestCase
$controller->index($request);
$this->assertEquals($this->session->get('form-data-username'), 'testuser');
$this->assertEquals($this->session->get('form-data-email'), 'foo.bar@localhost');
$this->assertEquals($this->session->get('form-data-first_name'), 'Test');
$this->assertEquals($this->session->get('form-data-last_name'), 'Tester');
$this->assertEquals($this->session->get('form-data-firstname'), 'Test');
$this->assertEquals($this->session->get('form-data-lastname'), 'Tester');
}