소스 검색

Fix save_account token

KernelDeimos 1 년 전
부모
커밋
a86106c0c1
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/backend/src/routers/save_account.js

+ 2 - 1
packages/backend/src/routers/save_account.js

@@ -158,7 +158,8 @@ router.post('/save_account', auth, express.json(), async (req, res, next)=>{
     }
 
     // create token for login
-    const token = await jwt.sign({uuid: user_uuid}, config.jwt_secret);
+    const svc_auth = req.services.get('auth');
+    const { token } = await svc_auth.create_session_token(req.user, { req });
 
     // user id
     // todo if pseudo user, assign directly no need to do another DB lookup