mirror of
https://github.com/outline/outline.git
synced 2025-12-21 10:39:41 -06:00
chore: Improve email sign-in debugging (#10455)
This commit is contained in:
@@ -150,16 +150,18 @@ const emailCallback = async (ctx: APIContext<T.EmailCallbackReq>) => {
|
|||||||
// Delete the code after successful verification
|
// Delete the code after successful verification
|
||||||
await VerificationCode.delete(email);
|
await VerificationCode.delete(email);
|
||||||
} else {
|
} else {
|
||||||
ctx.redirect("/?notice=auth-error");
|
ctx.redirect("/?notice=auth-error&description=Missing%20token");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
Logger.debug("authentication", err);
|
Logger.debug("authentication", err);
|
||||||
return ctx.redirect("/?notice=auth-error");
|
return ctx.redirect(`/?notice=auth-error&description=${err.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.team.emailSigninEnabled) {
|
if (!user.team.emailSigninEnabled) {
|
||||||
return ctx.redirect("/?notice=auth-error");
|
return ctx.redirect(
|
||||||
|
"/?notice=auth-error&description=Disabled%20signin%20method"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.isSuspended) {
|
if (user.isSuspended) {
|
||||||
@@ -195,13 +197,13 @@ const emailCallback = async (ctx: APIContext<T.EmailCallbackReq>) => {
|
|||||||
};
|
};
|
||||||
router.get(
|
router.get(
|
||||||
"email.callback",
|
"email.callback",
|
||||||
rateLimiter(RateLimiterStrategy.TenPerHour),
|
rateLimiter(RateLimiterStrategy.FivePerMinute),
|
||||||
validate(T.EmailCallbackSchema),
|
validate(T.EmailCallbackSchema),
|
||||||
emailCallback
|
emailCallback
|
||||||
);
|
);
|
||||||
router.post(
|
router.post(
|
||||||
"email.callback",
|
"email.callback",
|
||||||
rateLimiter(RateLimiterStrategy.TenPerHour),
|
rateLimiter(RateLimiterStrategy.FivePerMinute),
|
||||||
validate(T.EmailCallbackSchema),
|
validate(T.EmailCallbackSchema),
|
||||||
emailCallback
|
emailCallback
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user