improve fallbacks for redirection

This commit is contained in:
dswbx
2025-01-29 20:30:27 +01:00
parent 10db267164
commit 4755288fed

View File

@@ -316,10 +316,7 @@ export class Authenticator<Strategies extends Record<string, Strategy> = Record<
return c.json(data);
}
const successUrl = this.getSafeUrl(
c,
redirect ? redirect : (this.config.cookie.pathSuccess ?? "/")
);
const successUrl = this.getSafeUrl(c, redirect ?? this.config.cookie.pathSuccess ?? "/");
const referer = redirect ?? c.req.header("Referer") ?? successUrl;
//console.log("auth respond", { redirect, successUrl, successPath });