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

37
vendor/zitadel-auth/dist/svelte.js vendored Normal file
View File

@@ -0,0 +1,37 @@
import {
ZitadelAuth
} from "./chunk-NFH7JLJM.js";
// src/adapters/svelte.ts
var authInstance = null;
function createZitadelHandle(config) {
const auth = new ZitadelAuth(config);
authInstance = auth;
auth.init().then(() => {
if (!auth.isAuthenticated && !auth.error) {
auth.login();
}
});
return {
subscribe: (cb) => {
cb({
isAuthenticated: auth.isAuthenticated,
isLoading: auth.isLoading,
user: auth.user,
error: auth.error
});
return auth.onAuthChange(cb);
},
login: () => auth.login(),
logout: () => auth.logout(),
fetch: (url, init) => auth.fetch(url, init)
};
}
function getAuth() {
if (!authInstance) throw new Error("Call createZitadelHandle() before getAuth()");
return authInstance;
}
export {
createZitadelHandle,
getAuth
};