Fixed a nasty async race condition

This commit is contained in:
2023-06-27 04:25:52 +10:00
parent fd0c40d444
commit 44e19154ab
6 changed files with 11 additions and 13 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ const route = async (req, res) => {
}
//generate the JWTs
const { accessToken, refreshToken } = tokenGenerateRefresh(account.index, account.email, account.username, account.type, account.admin, account.mod);
const { accessToken, refreshToken } = await tokenGenerateRefresh(account.index, account.email, account.username, account.type, account.admin, account.mod);
//set the cookie
res.cookie('refreshToken', refreshToken, { path: '/', httpOnly: true, secure: true, sameSite: 'none', maxAge: 60 * 60 * 24 * 30 * 1000 }); //30 days