mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
Merge pull request #203 from bknd-io/fix/auth-redirect-and-adapter-config
fix auth redirect on error and adapter app fn
This commit is contained in:
@@ -70,7 +70,7 @@ export async function createAdapterApp<Config extends BkndConfig = BkndConfig, A
|
|||||||
connection = config.connection;
|
connection = config.connection;
|
||||||
} else {
|
} else {
|
||||||
const sqlite = (await import("bknd/adapter/sqlite")).sqlite;
|
const sqlite = (await import("bknd/adapter/sqlite")).sqlite;
|
||||||
const conf = config.connection ?? { url: ":memory:" };
|
const conf = appConfig.connection ?? { url: ":memory:" };
|
||||||
connection = sqlite(conf);
|
connection = sqlite(conf);
|
||||||
$console.info(`Using ${connection.name} connection`, conf.url);
|
$console.info(`Using ${connection.name} connection`, conf.url);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ export class Authenticator<Strategies extends Record<string, Strategy> = Record<
|
|||||||
|
|
||||||
await addFlashMessage(c, String(error), "error");
|
await addFlashMessage(c, String(error), "error");
|
||||||
|
|
||||||
const referer = this.getSafeUrl(c, opts?.redirect ?? c.req.header("Referer") ?? "/");
|
const referer = this.getSafeUrl(c, c.req.header("Referer") ?? "/");
|
||||||
return c.redirect(referer);
|
return c.redirect(referer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user