mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
updated adapters to automatically verify auth
This commit is contained in:
@@ -13,11 +13,13 @@ export type Options = {
|
||||
host?: string;
|
||||
};
|
||||
|
||||
export function getApi(Astro: TAstro, options: Options = { mode: "static" }) {
|
||||
return new Api({
|
||||
export async function getApi(Astro: TAstro, options: Options = { mode: "static" }) {
|
||||
const api = new Api({
|
||||
host: new URL(Astro.request.url).origin,
|
||||
headers: options.mode === "dynamic" ? Astro.request.headers : undefined
|
||||
});
|
||||
await api.verifyAuth();
|
||||
return api;
|
||||
}
|
||||
|
||||
let app: App;
|
||||
|
||||
Reference in New Issue
Block a user