fix(server): signup/signin logic (#4008)

This commit is contained in:
LongYinan
2023-08-29 19:22:56 +08:00
committed by GitHub
parent a046cdafa3
commit 54574e5cc3
8 changed files with 39 additions and 9 deletions

View File

@@ -21,6 +21,8 @@ function validateEmail(email: string) {
return emailRegex.test(email);
}
const INTERNAL_BETA_URL = `https://community.affine.pro/c/insider-general/`;
function handleSendEmailError(
res: SignInResponse | undefined,
pushNotification: (notification: Notification) => void
@@ -32,6 +34,13 @@ function handleSendEmailError(
type: 'error',
});
}
if (res?.status === 403 && res?.url === INTERNAL_BETA_URL) {
pushNotification({
title: 'Sign up error',
message: `You don't have early access permission\nVisit ${INTERNAL_BETA_URL} for more information`,
type: 'error',
});
}
}
export const SignIn: FC<AuthPanelProps> = ({