Skip to content

Commit

Permalink
Fixed login is authenticated checks
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Feb 24, 2024
1 parent b7a4e42 commit 882c883
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Exceptionless.Web/ClientApp/src/lib/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import { globalFetchClient } from './FetchClient';

import type { Login, TokenResult } from '$lib/models/api';

export const accessToken = persisted<string | null>('satellizer_token', null);
export const accessToken = persisted<string | null>('satellizer_token', null, {
serializer: {
parse: (s) => (s === 'null' ? null : s),
stringify: (s) => s as string
}
});

export const isAuthenticated = derived(accessToken, ($accessToken) => $accessToken !== null);
export const enableAccountCreation = env.PUBLIC_ENABLE_ACCOUNT_CREATION === 'true';
export const facebookClientId = env.PUBLIC_FACEBOOK_APPID;
Expand Down

0 comments on commit 882c883

Please sign in to comment.