Skip to content

Commit

Permalink
Fix redirect_uri casing, remove get route from test
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Mcgrath <adam.mcgrath@auth0.com>
  • Loading branch information
ewanharris and adamjmcgrath authored Jan 24, 2023
1 parent d3b472c commit cc87d20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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',
})
);

Expand Down
4 changes: 2 additions & 2 deletions examples/custom-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
);

Expand Down
5 changes: 0 additions & 5 deletions test/callback.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit cc87d20

Please sign in to comment.