feat: jwt auth. #7

Merged
Ivan merged 6 commits from feat-jwt-auth into master 2021-07-20 20:45:18 +08:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit c3c73fbe65 - Show all commits

View File

@ -11,7 +11,7 @@ export class AccountMiddleware implements NestMiddleware {
async use(req: any, res: any, next: () => void) {
const authPayload = req.header('authorization') ?? '';
if (!authPayload) {
req.user = req.session.user;
req.user = req.session?.user;
next();
return;
}