mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
improved nextjs/remix adapters and docs, confirmed remix ssr working
This commit is contained in:
@@ -257,11 +257,15 @@ export class Authenticator<Strategies extends Record<string, Strategy> = Record<
|
||||
return c.json(data);
|
||||
}
|
||||
|
||||
const referer = new URL(redirect ?? c.req.header("Referer") ?? "/");
|
||||
const successPath = "/";
|
||||
const successUrl = new URL(c.req.url).origin + successPath.replace(/\/+$/, "/");
|
||||
const referer = new URL(redirect ?? c.req.header("Referer") ?? successUrl);
|
||||
|
||||
if ("token" in data) {
|
||||
// @todo: add config
|
||||
await this.setAuthCookie(c, data.token);
|
||||
return c.redirect("/");
|
||||
// can't navigate to "/" – doesn't work on nextjs
|
||||
return c.redirect(successUrl);
|
||||
}
|
||||
|
||||
let message = "An error occured";
|
||||
|
||||
Reference in New Issue
Block a user