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

@ -19,6 +19,6 @@ db:
etcd:
hosts:
- 'http://192.168.31.194:2379'
workspaces:
root: '/Users/ivanli/Projects/fennec/workspaces'

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;
}