Update apps/backend/src/app/api/latest/auth/otp/send-sign-in-code/route.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Zai Shi 2025-07-25 00:30:19 +02:00 committed by GitHub
parent 62b7775574
commit 0bcafcd3b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,7 @@ export const POST = createSmartRouteHandler({
}),
async handler({ auth: { tenancy }, body: { email, callback_url: callbackUrl }, clientVersion }, fullReq) {
if (!tenancy.config.auth.otp.allowSignIn) {
throw new StatusError(StatusError.Forbidden, "Magic link is not enabled for this project");
throw new StatusError(StatusError.Forbidden, "OTP sign-in is not enabled for this project");
}
const user = await ensureUserForEmailAllowsOtp(tenancy, email);