Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/server/app-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export function getNextResponse(request: NextRequest, newAccessToken?: string) {
}

export type RouteHandlerArgs = {
redirectUri?: string
postLoginRedirectPathFn?: (req: NextRequest) => string
getDefaultActiveOrgId?: (req: NextRequest, user: UserFromToken) => string | undefined
}
Expand All @@ -102,7 +103,7 @@ export function getRouteHandlers(args?: RouteHandlerArgs) {
function signupOrLoginHandler(req: NextRequest, isSignup: boolean) {
const returnToPath = req.nextUrl.searchParams.get('return_to_path')
const state = randomState()
const redirectUri = getRedirectUri()
const redirectUri = args?.redirectUri ?? getRedirectUri()
const sameSite = getSameSiteCookieValue()

const authorizeUrlSearchParams = req.nextUrl.searchParams
Expand Down Expand Up @@ -146,7 +147,7 @@ export function getRouteHandlers(args?: RouteHandlerArgs) {
}

const authUrlOrigin = getAuthUrlOrigin()
const redirectUri = getRedirectUri()
const redirectUri = args?.redirectUri ?? getRedirectUri()
const integrationApiKey = getIntegrationApiKey()
const oauth_token_body = {
redirect_uri: redirectUri,
Expand Down