Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Auth/ConnectUserIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function createIdentity($user, $provider, $oauthUser)
'token'=> IdentityCrypt::encryptString($oauthUser->token),
'refresh_token'=> IdentityCrypt::encryptString($oauthUser->refreshToken),
'expires_at'=> $oauthUser->expiresIn ? now()->addSeconds($oauthUser->expiresIn) : null,
'registration' => true,
'registration' => false,
]
);
}
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ConnectControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public function test_connect_creates_identity()
$this->assertEquals(Carbon::create(2020, 11, 12, 10, 21), $updatedIdentity->expires_at);
$this->assertEquals('T2', IdentityCrypt::decryptString($updatedIdentity->token));
$this->assertEquals('RT2', IdentityCrypt::decryptString($updatedIdentity->refresh_token));
$this->assertFalse($updatedIdentity->registration);
}

public function test_connect_updates_existing_identity()
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/RegistrationControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function test_user_can_be_registered()
$this->assertEquals(IdentityCrypt::hash('U1'), $firstIdentity->provider_id);
$this->assertEquals('gitlab', $firstIdentity->provider);
$this->assertNotNull($firstIdentity->token);
$this->assertTrue($firstIdentity->registration);
}

public function test_user_cannot_register_twice()
Expand Down