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

Commit

Permalink
🐛 Fix token verify return value
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jul 17, 2019
1 parent b0c857a commit 9fa4d48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart-manager",
"version": "1.0.72",
"version": "1.0.73",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion setup/internal/staart-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.72
1.0.73
4 changes: 2 additions & 2 deletions src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class AuthController {
)
)
async login(req: Request, res: Response) {
res.json(await login(req.body.email, req.body.password, res.locals));
return await login(req.body.email, req.body.password, res.locals);
}

@Post("2fa")
Expand Down Expand Up @@ -163,7 +163,7 @@ export class AuthController {
const subject = req.body.subject;
try {
const data = await verifyToken(token, subject);
res.json({ verified: true, data });
return { verified: true, data };
} catch (error) {
throw new Error(ErrorCode.INVALID_TOKEN);
}
Expand Down

0 comments on commit 9fa4d48

Please sign in to comment.