mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fixed auth strategy toggle, updated astro/remix
This commit is contained in:
@@ -5,6 +5,7 @@ import "bknd/dist/styles.css";
|
||||
import { getApi } from "bknd/adapter/astro";
|
||||
|
||||
const api = getApi(Astro, { mode: "dynamic" });
|
||||
await api.verifyAuth();
|
||||
const user = api.getUser();
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
@@ -3,6 +3,8 @@ import { getApi } from "bknd/adapter/astro";
|
||||
import Card from "../components/Card.astro";
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
const api = getApi(Astro, { mode: "dynamic" });
|
||||
await api.verifyAuth();
|
||||
|
||||
const { data } = await api.data.readMany("todos");
|
||||
const user = api.getUser();
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ export const meta: MetaFunction = () => {
|
||||
|
||||
export const loader = async (args: LoaderFunctionArgs) => {
|
||||
const api = args.context.api;
|
||||
const user = (await api.getVerifiedAuthState(true)).user;
|
||||
await api.verifyAuth();
|
||||
const { data } = await api.data.readMany("todos");
|
||||
return { data, user };
|
||||
return { data, user: api.getUser() };
|
||||
};
|
||||
|
||||
export default function Index() {
|
||||
|
||||
Reference in New Issue
Block a user