We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11675e1 commit fb12a32Copy full SHA for fb12a32
pages/api/auth/[...nextauth].ts
@@ -168,10 +168,13 @@ export const authOptions: NextAuthOptions = {
168
}
169
},
170
async redirect({ url, baseUrl }) {
171
+ const ecasUrl = process.env.AUTH_ECAS_BASE_URL
172
// Allows relative callback URLs
173
if (url.startsWith('/')) return `${baseUrl}${url}`
174
// Allows callback URLs on the same origin
175
else if (new URL(url).origin === baseUrl) return url
176
+ // Allows callback URLs on ECAS
177
+ else if (new URL(url).origin === ecasUrl) return url
178
//else if (process.env.AUTH_ECAS_GLOBAL_LOGOUT_URL === url) return url
179
return baseUrl
180
0 commit comments