Skip to content

Commit

Permalink
Include callbackUrl in newUser page (#790)
Browse files Browse the repository at this point in the history
* Include callbackUrl in newUser page

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

Co-authored-by: Iain Collins <me@iaincollins.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
  • Loading branch information
3 people committed Dec 6, 2020
1 parent 47b8788 commit 1aea187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/routes/callback.js
Expand Up @@ -110,7 +110,7 @@ export default async (req, res, options, done) => {
// e.g. option to send users to a new account landing page on initial login
// Note that the callback URL is preserved, so the journey can still be resumed
if (isNewUser && pages.newUser) {
return redirect(pages.newUser)
return redirect(`${pages.newUser}${pages.newUser.includes('?') ? '&' : '?'}callbackUrl=${encodeURIComponent(callbackUrl)}`)
}

// Callback URL is already verified at this point, so safe to use if specified
Expand Down Expand Up @@ -200,7 +200,7 @@ export default async (req, res, options, done) => {
// e.g. option to send users to a new account landing page on initial login
// Note that the callback URL is preserved, so the journey can still be resumed
if (isNewUser && pages.newUser) {
return redirect(pages.newUser)
return redirect(`${pages.newUser}${pages.newUser.includes('?') ? '&' : '?'}callbackUrl=${encodeURIComponent(callbackUrl)}`)
}

// Callback URL is already verified at this point, so safe to use if specified
Expand Down

0 comments on commit 1aea187

Please sign in to comment.