[smarcet] - #4824 - Integration Testing : fix on Integrity constraint violation: 1062 Duplicate entry
'' for key 'openid_users_identifier_unique''
This commit is contained in:
parent
cae9e517c2
commit
198d2bb470
|
@ -74,6 +74,10 @@ class CustomAuthProvider implements UserProviderInterface
|
|||
if (is_null($member)) //member must exists
|
||||
throw new AuthenticationException(sprintf("member %s does not exists!", $identifier));
|
||||
|
||||
$valid_password = $member->checkPassword($password);
|
||||
|
||||
if(!$valid_password)
|
||||
throw new AuthenticationInvalidPasswordAttemptException($identifier,sprintf("invalid login attempt for user %s ",$identifier));
|
||||
|
||||
//if user does not exists, then create it
|
||||
if (is_null($user)) {
|
||||
|
@ -83,15 +87,11 @@ class CustomAuthProvider implements UserProviderInterface
|
|||
$user->identifier = $member->Email;
|
||||
$user->last_login_date = gmdate("Y-m-d H:i:s", time());
|
||||
$user->Save();
|
||||
$user = OpenIdUser::where('external_id', '=', $identifier)->first();
|
||||
}
|
||||
|
||||
$user_service = Registry::getInstance()->get(ServiceCatalog::UserService);
|
||||
|
||||
$valid_password = $member->checkPassword($password);
|
||||
|
||||
if(!$valid_password)
|
||||
throw new AuthenticationInvalidPasswordAttemptException($identifier,sprintf("invalid login attempt for user %s ",$identifier));
|
||||
|
||||
$user_name = $member->FirstName . "." . $member->Surname;
|
||||
//do association between user and member
|
||||
$user_service->associateUser($user->id, strtolower($user_name));
|
||||
|
|
|
@ -14,7 +14,6 @@ class UserService implements IUserService
|
|||
{
|
||||
try {
|
||||
$user = OpenIdUser::where('id', '=', $id)->first();
|
||||
if (!empty($user->identifier)) return $user->identifier;
|
||||
if (!is_null($user)) {
|
||||
\DB::transaction(function () use ($id, $proposed_username) {
|
||||
$done = false;
|
||||
|
|
Loading…
Reference in New Issue