fix: SAML: invalid_code issue, missing user error signing up (#15522)

* fix: Error thrown due to missing user

* chore: Remove unnecessary logs

* fix: Remove PageWrapper in order to prevent double signIn

* Change profile typing to optional

* further type fix

* further type fix..
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-06-24 14:53:23 +00:00
1 parent 7b69a6ab9c
commit dbf4be27ea
5 files changed
+4 -10

No files matched your search

@@ -281,9 +281,6 @@ if (isSAMLLoginEnabled) {
const user = await UserRepository.findByEmailAndIncludeProfilesAndPassword({
email: profile.email || "",
});
if (!user) throw new Error(ErrorCode.UserNotFound);
const [userProfile] = user.allProfiles;
return {
id: profile.id || 0,
firstName: profile.firstName || "",
@@ -292,7 +289,7 @@ if (isSAMLLoginEnabled) {
name: `${profile.firstName || ""} ${profile.lastName || ""}`.trim(),
email_verified: true,
locale: profile.locale,
profile: userProfile,
...(user ? { profile: user.allProfiles[0] } : {}),
};
},
options: {