fix: Post-auth subdomain redirect
This commit is contained in:
@@ -18,7 +18,13 @@ export default function createMiddleware(providerName: string) {
|
||||
|
||||
if (err.id) {
|
||||
const notice = err.id.replace(/_/g, "-");
|
||||
return ctx.redirect(`${err.redirectUrl || "/"}?notice=${notice}`);
|
||||
const hasQueryString = err.redirectUrl?.includes("?");
|
||||
|
||||
return ctx.redirect(
|
||||
`${err.redirectUrl || "/"}${
|
||||
hasQueryString ? "&" : "?"
|
||||
}notice=${notice}`
|
||||
);
|
||||
}
|
||||
|
||||
if (env.ENVIRONMENT === "development") {
|
||||
|
||||
@@ -60,11 +60,7 @@ export class StateStore {
|
||||
|
||||
url.host = appDomain.host;
|
||||
|
||||
return callback(
|
||||
AuthRedirectError(`redirect to: ${url.toString()}`, url.toString()),
|
||||
false,
|
||||
token
|
||||
);
|
||||
return callback(AuthRedirectError(``, url.toString()), false, token);
|
||||
}
|
||||
|
||||
// Destroy the one-time pad token and ensure it matches
|
||||
|
||||
Reference in New Issue
Block a user