feat: jwt auth. #7
@ -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