mirror of
https://github.com/logto-io/logto.git
synced 2025-03-31 22:51:25 -05:00
chore(core): remove unused checkMissingRequiredSignUpIdentifiers
(#2571)
This commit is contained in:
parent
bb53b32c1d
commit
b8f0b0cca2
1 changed files with 0 additions and 27 deletions
|
@ -194,33 +194,6 @@ export const checkRequiredProfile = async (
|
|||
throw new RequestError({ code: 'user.require_sms', status: 422 });
|
||||
}
|
||||
};
|
||||
|
||||
export const checkMissingRequiredSignUpIdentifiers = async (identifiers: {
|
||||
primaryEmail?: Nullable<string>;
|
||||
primaryPhone?: Nullable<string>;
|
||||
}) => {
|
||||
// We do not check username as we decided to prohibit the removal of username from user profile.
|
||||
const { primaryEmail, primaryPhone } = identifiers;
|
||||
|
||||
const { signUp } = await getSignInExperienceForApplication();
|
||||
|
||||
if (
|
||||
signUp.identifiers.includes(SignInIdentifier.Email) &&
|
||||
signUp.identifiers.includes(SignInIdentifier.Sms) &&
|
||||
!primaryEmail &&
|
||||
!primaryPhone
|
||||
) {
|
||||
throw new RequestError({ code: 'user.require_email_or_sms', status: 422 });
|
||||
}
|
||||
|
||||
if (signUp.identifiers.includes(SignInIdentifier.Email) && !primaryEmail) {
|
||||
throw new RequestError({ code: 'user.require_email', status: 422 });
|
||||
}
|
||||
|
||||
if (signUp.identifiers.includes(SignInIdentifier.Sms) && !primaryPhone) {
|
||||
throw new RequestError({ code: 'user.require_sms', status: 422 });
|
||||
}
|
||||
};
|
||||
/* eslint-enable complexity */
|
||||
|
||||
export const checkSignUpIdentifierCollision = async (
|
||||
|
|
Loading…
Add table
Reference in a new issue