Fixed user exist checking with trimmed email input #3195 (#3251)

This commit is contained in:
rakan makhashin 2024-01-05 17:13:05 +03:00 committed by GitHub
parent f7034d6e7d
commit 036c8c0b36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,7 @@ export const useSignInUp = () => {
} }
checkUserExistsQuery({ checkUserExistsQuery({
variables: { variables: {
email: form.getValues('email').toLowerCase(), email: form.getValues('email').toLowerCase().trim(),
}, },
onCompleted: (data) => { onCompleted: (data) => {
if (data?.checkUserExists.exists) { if (data?.checkUserExists.exists) {
@ -130,11 +130,11 @@ export const useSignInUp = () => {
const { workspace: currentWorkspace } = const { workspace: currentWorkspace } =
signInUpMode === SignInUpMode.SignIn signInUpMode === SignInUpMode.SignIn
? await signInWithCredentials( ? await signInWithCredentials(
data.email.toLowerCase(), data.email.toLowerCase().trim(),
data.password, data.password,
) )
: await signUpWithCredentials( : await signUpWithCredentials(
data.email.toLowerCase(), data.email.toLowerCase().trim(),
data.password, data.password,
workspaceInviteHash, workspaceInviteHash,
); );