sveltekit-zitadel-oidc
Advanced tools
Comparing version 0.0.5 to 0.0.6
// oidc.ts | ||
import { UserManager, WebStorageStateStore, User } from "oidc-client-ts"; | ||
import { goto } from "$app/navigation"; | ||
import { isAuthenticated, user } from "./store"; | ||
import { isAuthenticated, user } from "./store.js"; | ||
import { browser } from "$app/environment"; | ||
@@ -114,6 +114,7 @@ import { env } from '$env/dynamic/public'; | ||
try { | ||
await action(); | ||
return await action(); | ||
} | ||
catch (error) { | ||
console.error('OIDC action failed', error); | ||
return undefined; | ||
} | ||
@@ -168,3 +169,3 @@ } | ||
return null; | ||
return await executeWithErrorHandling(() => userManager.getUser()); | ||
return await executeWithErrorHandling(() => userManager.getUser()) || null; | ||
} | ||
@@ -171,0 +172,0 @@ /** |
{ | ||
"name": "sveltekit-zitadel-oidc", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
11062
238