fix: add query user config to redirect home

This commit is contained in:
2025-04-02 22:16:11 +08:00
parent 912d3196cf
commit 3b32ba7244
8 changed files with 238 additions and 14 deletions

View File

@@ -47,12 +47,13 @@ export const getLoginUser = async (req: http.IncomingMessage) => {
const parsedCookies = cookie.parse(req.headers.cookie || '');
token = parsedCookies.token || '';
}
const parsedCookies = cookie.parse(req.headers.cookie || '');
console.log('getLoginUser', parsedCookies, 'parsedCookies.token', parsedCookies.token);
if (token) {
token = token.replace('Bearer ', '');
}
if (!token) {
return null;
}
let tokenUser;
try {
tokenUser = await User.verifyToken(token);