mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Fix STACK-BACKEND-67
This commit is contained in:
parent
20e3922390
commit
3cd66c4c58
@ -13,10 +13,6 @@ const OAuthUserInfoSchema = yupObject({
|
||||
|
||||
export function validateUserInfo(
|
||||
userInfo: Partial<yup.InferType<typeof OAuthUserInfoSchema>>,
|
||||
options?: { expectNoEmail?: boolean }
|
||||
): OAuthUserInfo {
|
||||
if (!options?.expectNoEmail && !userInfo.email) {
|
||||
throw new Error("Email is required");
|
||||
}
|
||||
return OAuthUserInfoSchema.validateSync(userInfo);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user