fix: commit vendored @kuns/zitadel-auth dist (was excluded by dist/ gitignore)

This commit is contained in:
2026-06-10 08:22:38 +00:00
parent 7331fe75e8
commit ab2f9affd1
24 changed files with 1707 additions and 1 deletions

38
vendor/zitadel-auth/dist/vue.js vendored Normal file
View File

@@ -0,0 +1,38 @@
import {
ZitadelAuth
} from "./chunk-NFH7JLJM.js";
// src/adapters/vue.ts
import { reactive, toRefs } from "vue";
function useZitadelAuth(router, config) {
const auth = new ZitadelAuth(config);
const state = reactive({
isAuthenticated: false,
isLoading: true,
user: null,
error: null
});
auth.onAuthChange((s) => {
state.isAuthenticated = s.isAuthenticated;
state.isLoading = s.isLoading;
state.user = s.user;
state.error = s.error;
});
const initPromise = auth.init();
router.beforeEach(async (to) => {
if (to.path.includes("/auth/callback")) return true;
await initPromise;
if (auth.isAuthenticated) return true;
auth.login();
return false;
});
return {
...toRefs(state),
login: () => auth.login(),
logout: () => auth.logout(),
fetch: (url, init) => auth.fetch(url, init)
};
}
export {
useZitadelAuth
};