Skip to content

Commit

Permalink
fix: no return user info login with local
Browse files Browse the repository at this point in the history
  • Loading branch information
ChingCdesu committed Oct 1, 2023
1 parent 6522353 commit 84af12d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supernode",
"version": "1.0.0-alpha.12",
"version": "1.0.0-alpha.13",
"description": "",
"author": "",
"private": true,
Expand Down
7 changes: 6 additions & 1 deletion src/common/middlewares/user.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export class UserMiddleware implements NestMiddleware {
private readonly _userModel: typeof User,
) {}
use(req: Request, res: Response, next: NextFunction) {
if (!req.user || req.user.id) {
if (!req.user) {
next();
return;
}
if (req.user.id) {
req.localUser = req.user as User;
next();
return;
}
Expand Down

0 comments on commit 84af12d

Please sign in to comment.