MagicLinkAuthMethod: do not interrupt auth with used magic links

This commit is contained in:
Alice Gaudon 2021-01-25 14:02:58 +01:00
parent a314c9a55a
commit 449922490f

View File

@ -49,6 +49,7 @@ export default class MagicLinkAuthMethod implements AuthMethod<MagicLink> {
public async interruptAuth(req: Request, res: Response): Promise<boolean> {
const pendingLink = await MagicLink.select()
.where('session_id', req.getSession().id)
.where('used', 0)
.first();
if (pendingLink) {