Fix destructuring

This commit is contained in:
KernelDeimos
2024-04-11 23:27:43 -04:00
parent 8135e076c2
commit f4f58dbfb9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ router.post('/login', express.json(), body_parser_error_handler, async (req, res
// check password
if(await bcrypt.compare(req.body.password, user.password)){
const svc_auth = req.services.get('auth');
const token = await svc_auth.create_session_token(user, { req });
const { token } = await svc_auth.create_session_token(user, { req });
//set cookie
// res.cookie(config.cookie_name, token);
res.cookie(config.cookie_name, token, {
+1 -1
View File
@@ -247,7 +247,7 @@ module.exports = eggspress(['/signup'], {
);
// create token for login
const token = await svc_auth.create_session_token(user, {
const { token } = await svc_auth.create_session_token(user, {
req,
});
// jwt.sign({uuid: user_uuid}, config.jwt_secret);