feat: mobile-first web client (login, lists, add task)
This commit is contained in:
13
app/plugins/auth.client.ts
Normal file
13
app/plugins/auth.client.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useZitadelAuth } from "@kuns/zitadel-auth/vue";
|
||||
|
||||
// Wire the framework-agnostic Zitadel OIDC client to Nuxt's router (client-only SPA).
|
||||
// Provides `$auth` (reactive state + login/logout/fetch). The adapter installs a
|
||||
// router guard that redirects unauthenticated users to the Zitadel hosted login.
|
||||
export default defineNuxtPlugin(() => {
|
||||
const cfg = useRuntimeConfig().public;
|
||||
const auth = useZitadelAuth(useRouter() as never, {
|
||||
clientId: cfg.zitadelClientId as string,
|
||||
issuer: cfg.zitadelIssuer as string,
|
||||
});
|
||||
return { provide: { auth } };
|
||||
});
|
||||
Reference in New Issue
Block a user