fbed7b0c by Adam Heath

Tweaks to the /token paths.

1 parent d7be2e0c
...@@ -20,8 +20,8 @@ const defaultOptions = { ...@@ -20,8 +20,8 @@ const defaultOptions = {
20 callback: '/login/callback', 20 callback: '/login/callback',
21 logout: '/logout', 21 logout: '/logout',
22 logoutReturnTo: '/', 22 logoutReturnTo: '/',
23 refreshToken: '/login/refresh/token', 23 refreshToken: '/login/token/refresh',
24 tokens: '/login/tokens', 24 token: '/login/token',
25 }, 25 },
26 session: { 26 session: {
27 secret: 'some-secret', 27 secret: 'some-secret',
...@@ -201,7 +201,7 @@ export default async (...options) => { ...@@ -201,7 +201,7 @@ export default async (...options) => {
201 const { user: { tokenSet: { access_token, expires_at } = {} } = {} } = passport 201 const { user: { tokenSet: { access_token, expires_at } = {} } = {} } = passport
202 res.end(JSON.stringify({ access_token, expires_at })) 202 res.end(JSON.stringify({ access_token, expires_at }))
203 }) 203 })
204 auth.get(options.auth.tokens, async (req, res, next) => { 204 auth.get(options.auth.token, async (req, res, next) => {
205 const passport = await refreshToken(req, true) 205 const passport = await refreshToken(req, true)
206 if (passport) { 206 if (passport) {
207 const { user: { tokenSet } } = passport 207 const { user: { tokenSet } } = passport
......