@nebulr-group/bridge-svelte 0.1.0-beta.1 → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { getRouteGuardConfig } from '../client/stores/config.store.js';
3
3
  import { isFeatureEnabled } from '../shared/feature-flag.js';
4
4
  import { logger } from '../shared/logger.js';
5
5
  import { auth } from '../shared/services/auth.service.js';
6
- const { isAubridgenticated, createLoginUrl } = auth;
6
+ const { isAuthenticated, createLoginUrl } = auth;
7
7
  function escapeRegex(text) {
8
8
  return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
9
9
  }
@@ -57,8 +57,8 @@ export function createRouteGuard() {
57
57
  }
58
58
  function shouldRedirectToLogin(pathname) {
59
59
  const isProtected = isProtectedRoute(pathname);
60
- const aubridgenticated = get(isAubridgenticated);
61
- if (isProtectedRoute(pathname) && !get(isAubridgenticated)) {
60
+ const aubridgenticated = get(isAuthenticated);
61
+ if (isProtectedRoute(pathname) && !get(isAuthenticated)) {
62
62
  logger.debug(`[route-guard] path ${pathname} is protected and user is not aubridgenticated`);
63
63
  return true;
64
64
  }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { auth } from '../../../shared/services/auth.service';
3
- const { isAubridgenticated, login } = auth;
3
+ const { isAuthenticated, login } = auth;
4
4
  </script>
5
5
 
6
6
  <button onclick={() => login()} class="login-button">
@@ -49,7 +49,7 @@
49
49
  onMount(async () => {
50
50
  logger.debug('TeamManagement onMount');
51
51
  try {
52
- if (!auth.isAubridgenticated) {
52
+ if (!auth.isAuthenticated) {
53
53
  logger.debug('TeamManagement onMount: User is not aubridgenticated');
54
54
  throw new Error('User must be aubridgenticated to access team management');
55
55
  }
@@ -10,7 +10,7 @@ declare function handleCallback(code: string): Promise<void>;
10
10
  declare function refreshToken(refreshToken: string): Promise<TokenSet | null>;
11
11
  export declare const auth: {
12
12
  token: import("svelte/store").Writable<any>;
13
- isAubridgenticated: import("svelte/store").Readable<boolean>;
13
+ isAuthenticated: import("svelte/store").Readable<boolean>;
14
14
  isLoading: import("svelte/store").Writable<boolean>;
15
15
  error: import("svelte/store").Writable<string | null>;
16
16
  login: typeof login;
@@ -192,11 +192,11 @@ export async function maybeRefreshNow() {
192
192
  return true;
193
193
  }
194
194
  // --- Derived values ---
195
- const isAubridgenticated = derived(tokenStore, $t => !!$t?.accessToken);
195
+ const isAuthenticated = derived(tokenStore, $t => !!$t?.accessToken);
196
196
  // --- Exports ---
197
197
  export const auth = {
198
198
  token: tokenStore,
199
- isAubridgenticated,
199
+ isAuthenticated,
200
200
  isLoading,
201
201
  error,
202
202
  login,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulr-group/bridge-svelte",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
 
5
5
  "description": "Bridge Svelte library, This library helps you to add bridge authentication and feature flags, and payments to your svelte application.",
6
6
  "author": "Iman Pouya",