Skip to content

Commit

Permalink
fix: rename state user login
Browse files Browse the repository at this point in the history
  • Loading branch information
masb0ymas committed Feb 4, 2021
1 parent 79f6c01 commit 962ac76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/controllers/Auth/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ routes.get(
'/profile',
Authorization,
asyncHandler(async function getProfile(req: Request, res: Response) {
const userData = req.getState('user')
const userData = req.getState('userLogin')

// @ts-ignore
const data = await AuthService.profile(userData)
Expand All @@ -68,7 +68,7 @@ routes.post(
Authorization,
asyncHandler(async function logout(req: Request, res: Response) {
const { UserId } = req.getBody()
const userData = req.getState('user')
const userData = req.getState('userLogin')

const message = await AuthService.logout(UserId, userData)
const buildResponse = BuildResponse.deleted({ message })
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/Authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function Authorization(req: Request, res: Response, next: NextFunction) {
})
}

req.setState({ user: token?.data })
req.setState({ userLogin: token?.data })
next()
}

Expand Down

0 comments on commit 962ac76

Please sign in to comment.