Skip to content

Handling redirect uri based on different domains #249

Closed Answered by sergiodxa
ian038 asked this question in Q&A
Discussion options

You must be logged in to vote

The recommended solution for this is to create a function that returns the authenticator and setup strategies, this function can receive the request or any other argument you may need to setup the redirect uri.

export function createAuthenticator(request: Request) {
  let url = new URL(request.url)
  let auth = new Authenticator()
  auth.use(new MyStrategy({ redirectURI: new URL(url, "/callback").toString() }))
  return auth
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ian038
Comment options

Comment options

You must be logged in to vote
1 reply
@ian038
Comment options

Answer selected by sergiodxa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants