From a2ce13a7dd5be77af28155431c4164e2b1e70c4d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 23 Oct 2025 01:32:25 +0200 Subject: [PATCH] chore: Improve email sign-in debugging (#10455) --- plugins/email/server/auth/email.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/email/server/auth/email.ts b/plugins/email/server/auth/email.ts index 9be4cc78e7..361c569d14 100644 --- a/plugins/email/server/auth/email.ts +++ b/plugins/email/server/auth/email.ts @@ -150,16 +150,18 @@ const emailCallback = async (ctx: APIContext) => { // Delete the code after successful verification await VerificationCode.delete(email); } else { - ctx.redirect("/?notice=auth-error"); + ctx.redirect("/?notice=auth-error&description=Missing%20token"); return; } } catch (err) { Logger.debug("authentication", err); - return ctx.redirect("/?notice=auth-error"); + return ctx.redirect(`/?notice=auth-error&description=${err.message}`); } if (!user.team.emailSigninEnabled) { - return ctx.redirect("/?notice=auth-error"); + return ctx.redirect( + "/?notice=auth-error&description=Disabled%20signin%20method" + ); } if (user.isSuspended) { @@ -195,13 +197,13 @@ const emailCallback = async (ctx: APIContext) => { }; router.get( "email.callback", - rateLimiter(RateLimiterStrategy.TenPerHour), + rateLimiter(RateLimiterStrategy.FivePerMinute), validate(T.EmailCallbackSchema), emailCallback ); router.post( "email.callback", - rateLimiter(RateLimiterStrategy.TenPerHour), + rateLimiter(RateLimiterStrategy.FivePerMinute), validate(T.EmailCallbackSchema), emailCallback );