Skip to content

Commit a1a8ada

Browse files
committed
Refactors authentication logic
Simplifies authentication checks by using a boolean conversion for the access token. Ensures that the access token is set to null instead of an empty string when a 401 error is encountered and not explicitly handled, improving consistency.
1 parent 70cb15b commit a1a8ada

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Exceptionless.Web/ClientApp/src/routes/(app)/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
3939
let { children }: Props = $props();
40-
let isAuthenticated = $derived(accessToken.current !== null);
40+
let isAuthenticated = $derived(!!accessToken.current);
4141
const sidebar = useSidebar();
4242
let isCommandOpen = $state(false);
4343

src/Exceptionless.Web/ClientApp/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
4444
if (status === 401 && !ctx.options.expectedStatusCodes?.includes(401)) {
45-
accessToken.current = '';
45+
accessToken.current = null;
4646
return;
4747
}
4848

0 commit comments

Comments
 (0)