Skip to content

Commit

Permalink
Fix users.registration_channel null constraint
Browse files Browse the repository at this point in the history
remp/crm#1976
  • Loading branch information
Matefko committed Aug 6, 2021
1 parent 589ad44 commit 26a1eaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/model/Auth/Sso/GoogleSignIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public function signInUsingIdToken(string $idToken): ?IRow
$userEmail,
UserConnectedAccountsRepository::TYPE_GOOGLE_SIGN_IN,
self::USER_SOURCE_GOOGLE_SSO,
$payload
$payload,
null,
self::USER_GOOGLE_REGISTRATION_CHANNEL
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/Auth/Sso/SsoUserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getUser(string $externalId, string $email, string $type, string
->setActive(true)
->setIsInstitution(false)
->setSource($source)
->setRegistrationChannel($registrationChannel)
->setRegistrationChannel($registrationChannel ?? UsersRepository::DEFAULT_REGISTRATION_CHANNEL)
->setAddTokenOption(false)
->save();
}
Expand Down

0 comments on commit 26a1eaa

Please sign in to comment.