From b404d063527eea9e7dd97f2ec6ad37df089b8cae Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 24 Jan 2023 11:16:56 +0000 Subject: [PATCH] Fix redirect_uri casing, remove get route from test Co-authored-by: Adam Mcgrath --- EXAMPLES.md | 6 +++--- examples/custom-routes.js | 4 ++-- test/callback.tests.js | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index ed5024ec..f5acb2db 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -75,7 +75,7 @@ Full example at [routes.js](./examples/routes.js), to run it: `npm run start:exa If you need to customize the provided login, logout, and callback routes, you can disable the default routes and write your own route handler and pass custom paths to mount the handler at that path. -When overriding the callback route your should pass a `authorizationParams.redirect_uri` value on `res.oidc.login` and a `redirectUri` value on your `res.oidc.callback` call. +When overriding the callback route you should pass a `authorizationParams.redirect_uri` value on `res.oidc.login` and a `redirectUri` value on your `res.oidc.callback` call. ```js app.use( @@ -104,13 +104,13 @@ app.get('/custom-logout', (req, res) => res.send('Bye!')); app.get('/callback', (req, res) => res.oidc.callback({ - redirect_uri: 'http://localhost:3000/callback', + redirectUri: 'http://localhost:3000/callback', }) ); app.post('/callback', express.urlencoded({ extended: false }), (req, res) => res.oidc.callback({ - redirect_uri: 'http://localhost:3000/callback', + redirectUri: 'http://localhost:3000/callback', }) ); diff --git a/examples/custom-routes.js b/examples/custom-routes.js index c3ec0b84..80350418 100644 --- a/examples/custom-routes.js +++ b/examples/custom-routes.js @@ -37,13 +37,13 @@ app.get('/custom-logout', (req, res) => res.send('Bye!')); app.get('/callback', (req, res) => res.oidc.callback({ - redirect_uri: 'http://localhost:3000/callback', + redirectUri: 'http://localhost:3000/callback', }) ); app.post('/callback', express.urlencoded({ extended: false }), (req, res) => res.oidc.callback({ - redirect_uri: 'http://localhost:3000/callback', + redirectUri: 'http://localhost:3000/callback', }) ); diff --git a/test/callback.tests.js b/test/callback.tests.js index a397f706..d379e869 100644 --- a/test/callback.tests.js +++ b/test/callback.tests.js @@ -1206,11 +1206,6 @@ describe('callback response_mode: form_post', () => { }, }; const router = auth(config); - router.get('/callback', (req, res) => { - res.oidc.callback({ - redirectUri: 'http://localhost:3000/callback', - }); - }); router.post('/callback', (req, res) => { res.set('foo', 'bar');