feat: jwt auth. #7
@ -19,6 +19,6 @@ db:
|
|||||||
etcd:
|
etcd:
|
||||||
hosts:
|
hosts:
|
||||||
- 'http://192.168.31.194:2379'
|
- 'http://192.168.31.194:2379'
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
root: '/Users/ivanli/Projects/fennec/workspaces'
|
root: '/Users/ivanli/Projects/fennec/workspaces'
|
@ -11,7 +11,7 @@ export class AccountMiddleware implements NestMiddleware {
|
|||||||
async use(req: any, res: any, next: () => void) {
|
async use(req: any, res: any, next: () => void) {
|
||||||
const authPayload = req.header('authorization') ?? '';
|
const authPayload = req.header('authorization') ?? '';
|
||||||
if (!authPayload) {
|
if (!authPayload) {
|
||||||
req.user = req.session.user;
|
req.user = req.session?.user;
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user