mirror of
https://github.com/outline/outline.git
synced 2026-11-30 17:10:36 +03:00
fix: Prevent email login token reuse
This commit is contained in:
1 parent
70bc8f1a5a
commit
7eb6dcf00b
1 file changed
+6
@@ -91,6 +91,12 @@ export async function getUserForEmailSigninToken(token: string): Promise<User> {
|
||||
rejectOnEmpty: true,
|
||||
});
|
||||
|
||||
if (user.lastSignedInAt) {
|
||||
if (user.lastSignedInAt > new Date(payload.createdAt)) {
|
||||
throw AuthenticationError("Expired token");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
JWT.verify(token, user.jwtSecret);
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user