-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Factor cookie extraction out for use elsewhere * Remove dead code * Remove dead code * Refactor constants onto app context * Add userinfo route * Improved logging of health check failure * Bugfix * Tests. Version. * Route handler test * Use jsonwebtoken instead of jwt-decode * Return userinfo from login route * Set Path correctly when clearing token cookie on logout
- Loading branch information
1 parent
9ddc3af
commit 45afa83
Showing
11 changed files
with
10,097 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { getTokenCookieFromRequest, buildUserInfoResponse } = require('../lib/handlerHelpers'); | ||
|
||
const handler = (router) => { | ||
router.get('/userinfo', async (ctx, next) => { | ||
// Our request has already passed token validation | ||
const tokenEnc = getTokenCookieFromRequest(ctx); | ||
|
||
ctx.response.body = buildUserInfoResponse(tokenEnc); | ||
ctx.response.status = 200; | ||
|
||
await next(); | ||
}); | ||
}; | ||
|
||
module.exports = handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.