Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Try fixing token validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed May 31, 2019
1 parent 7b9b329 commit c9d5e02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ export class AuthController {
@Post("approve-location")
@Middleware(authHandler)
async getApproveLocation(req: Request, res: Response) {
const token =
req.body.token || (req.get("Authorization") || "").replace("Bearer ", "");
const token = req.body.token || req.params.token;
joiValidate({ token: Joi.string().required() }, { token });
res.json(await approveLocation(token, res.locals));
}
Expand Down

0 comments on commit c9d5e02

Please sign in to comment.