Skip to content

Commit

Permalink
added backdoor token for developemnt
Browse files Browse the repository at this point in the history
  • Loading branch information
gohanko committed Aug 25, 2024
1 parent 6a3fd49 commit 6120687
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions middlewares/mustBeAuthorized.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ const mustBeAuthorized = async (
.json({ message: "This session has expired. Please login" });
}

if (accessToken == 'backdoor_for_testing') {
const user = await User.findByPk(2)
const {
password,
...data
} = user?.dataValues;

req.user = data
next()
}

jwt.verify(
accessToken,
SECRET_ACCESS_TOKEN as string,
Expand Down

0 comments on commit 6120687

Please sign in to comment.