@atlasauth/capacitor 0.1.1 → 0.2.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlasauth/capacitor changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Changed
6
+ - **`signOut(options?: SignOutOptions)` now resolves `Promise<SignOutResult>`** (`{ revoked: boolean; activeSessionId?: string }`)
7
+ instead of `Promise<void>`, and revokes the session on the Frontend API (it used to only clear local state). Existing
8
+ `await atlas.signOut()` call sites keep working. The revoke is authenticated as the session being dropped, retried once,
9
+ then re-tried in the background (a 401 from an expired JWT rotates it once with the refresh token). `{ strict: true }`
10
+ rejects with `SignOutError` (`code: 'SIGN_OUT_REVOKE_FAILED'`, `sessionId`, `status`) after the local sign-out.
11
+ `activeSessionId` (a server-promoted session) is reported but not adopted: the bearer revoke never returns a credential
12
+ for it.
13
+ - **A signed-out session is never re-adopted.** Its id is remembered (a tombstone, via `SignOutGuard` from
14
+ `@atlasauth/js`) in the platform store before the revoke; the next app start refuses a stored session that is tombstoned
15
+ (and clears it), and a refresh still in flight at sign-out can no longer write the session back or resurrect it in
16
+ memory. A refused session's revoke is re-tried in the background and its tombstone dropped once the server confirms.
17
+ - `getToken()` / `authHeaders()` return no bearer for a session signed out while a refresh was in flight; `onChange()`
18
+ listeners are not called for a signed-out session.
19
+
20
+ ### Added
21
+ - `CreateAtlasCapacitorConfig.tombstoneStore?: TombstoneStore` (default: `@capacitor/preferences` when present, else the
22
+ WebView's `localStorage`) and `CreateAtlasCapacitorConfig.signOutRetryDelaysMs?: number[]`.
23
+ - `createPreferencesTombstoneStore(preferences)` and `tombstoneStoreFromTokenStore(store)` adapters.
24
+ - `NativeSessionConfig.refuse?: (session: NativeSession) => boolean` on `createNativeSessionManager()`.
25
+ - Re-exports `SignOutError`, `SignOutOptions`, `SignOutResult` and `TombstoneStore` from `@atlasauth/js`.
26
+
3
27
  ## 0.1.1
4
28
  - **`frontendApi` is validated at `createAtlasCapacitor()`.** A missing, empty or malformed value now throws an
5
29
  `AtlasConfigError` (from `@atlasauth/js`; `code: 'FRONTEND_API_REQUIRED'` or `'FRONTEND_API_INVALID'`)
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * (the sign-in flow, the token store, the PKCE helpers) is exposed for apps that
17
17
  * want to drive the pieces themselves.
18
18
  */
19
- import { type NativeSession, type NativeSessionManager } from '@atlasauth/js';
19
+ import { NativeSessionManager, type NativeSession, type SignOutOptions, type SignOutResult, type TombstoneStore } from '@atlasauth/js';
20
20
  import { type CapacitorPlugins } from './plugins';
21
21
  import { type SignInOutcome } from './sign-in';
22
22
  import { type TokenStore } from './token-store';
@@ -40,6 +40,19 @@ export interface CreateAtlasCapacitorConfig {
40
40
  storage?: TokenStore;
41
41
  /** Where the transient PKCE material is stashed on the WEB redirect path. */
42
42
  pkceStore?: TokenStore;
43
+ /**
44
+ * Where the ids of sessions this app signed out of are kept, so a restart
45
+ * never re-adopts one (even when the revoke never reached the server).
46
+ * Defaults to `@capacitor/preferences` when present, else the WebView's
47
+ * `localStorage`. Adapt a secure-storage {@link TokenStore} with
48
+ * `tombstoneStoreFromTokenStore()` (give it its own slot).
49
+ */
50
+ tombstoneStore?: TombstoneStore;
51
+ /**
52
+ * Delays (ms) between background re-tries of a revoke `signOut()` could not
53
+ * complete. @default `[15_000, 60_000, 300_000]`
54
+ */
55
+ signOutRetryDelaysMs?: number[];
43
56
  /** Inject the Capacitor plugins (tests). Defaults to a lazy, guarded load. */
44
57
  plugins?: CapacitorPlugins;
45
58
  /** Injectable for tests; defaults to the platform `fetch`. */
@@ -75,8 +88,18 @@ export interface AtlasCapacitor {
75
88
  * (or null when there is nothing to complete).
76
89
  */
77
90
  handleRedirectCallback(url?: string): Promise<NativeSession | null>;
78
- /** Forget the session and clear the store (sign-out). */
79
- signOut(): Promise<void>;
91
+ /**
92
+ * Sign out: remember the session id (so nothing re-adopts it — not a refresh
93
+ * in flight, not the next app start), revoke it on the Frontend API (retried
94
+ * once, then in the background, authenticated as the dropped session), and
95
+ * forget it locally. Resolves `{ revoked }` — `false` when the server could
96
+ * not be reached (the app is signed out regardless). With `{ strict: true }`
97
+ * it rejects with a `SignOutError` instead, after the local sign-out.
98
+ *
99
+ * A bearer client never gets a server-promoted session's credential back from
100
+ * the revoke, so `activeSessionId` is reported (when present) but not adopted.
101
+ */
102
+ signOut(options?: SignOutOptions): Promise<SignOutResult>;
80
103
  /** The current session JWT, auto-refreshed near expiry; null when signed out. */
81
104
  getToken(): Promise<string | null>;
82
105
  /** The headers an authenticated `/v1/client/me/*` call needs (bearer + pk). */
@@ -109,6 +132,7 @@ export interface AtlasCapacitor {
109
132
  * ```
110
133
  */
111
134
  export declare function createAtlasCapacitor(config: CreateAtlasCapacitorConfig): Promise<AtlasCapacitor>;
135
+ export { SignOutError, type SignOutOptions, type SignOutResult, type TombstoneStore, } from '@atlasauth/js';
112
136
  export * from './plugins';
113
137
  export * from './pkce';
114
138
  export * from './token-store';
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
32
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.refreshNativeSession = exports.exchangeForSession = exports.NativeSessionManager = exports.clearNativeSession = exports.createNativeSessionManager = void 0;
35
+ exports.refreshNativeSession = exports.exchangeForSession = exports.NativeSessionManager = exports.clearNativeSession = exports.createNativeSessionManager = exports.SignOutError = void 0;
36
36
  exports.createAtlasCapacitor = createAtlasCapacitor;
37
37
  const js_1 = require("@atlasauth/js");
38
38
  const plugins_1 = require("./plugins");
@@ -77,6 +77,47 @@ async function createAtlasCapacitor(config) {
77
77
  (plugins.Preferences
78
78
  ? (0, token_store_1.createPreferencesTokenStore)(plugins.Preferences, sign_in_1.PKCE_STASH_KEY)
79
79
  : (0, token_store_1.createInMemoryTokenStore)());
80
+ const doFetch = config.fetchImpl ?? ((input, init) => fetch(input, init));
81
+ /**
82
+ * A Frontend API request authenticated as `session` — and only it. Holds its
83
+ * own copy (never persisted), so a revoke re-tried after sign-out dropped the
84
+ * session can still authenticate: a 401 (the short-lived JWT expired) rotates
85
+ * it once with the refresh token and tries again.
86
+ */
87
+ const sessionBoundRequest = (session) => {
88
+ const holder = new js_1.NativeSessionManager({
89
+ baseUrl: frontendApi,
90
+ publishableKey: config.publishableKey,
91
+ initial: session,
92
+ fetchImpl: config.fetchImpl,
93
+ now: config.now,
94
+ });
95
+ return async (path, init) => {
96
+ const send = async () => doFetch(`${frontendApi}${path}`, {
97
+ ...init,
98
+ headers: { ...(await holder.authHeaders()), ...init?.headers },
99
+ });
100
+ const response = await send();
101
+ if (response.status !== 401 || !(await holder.refresh()))
102
+ return response;
103
+ return send();
104
+ };
105
+ };
106
+ // The sessions this app signed out of, kept in the platform store so a
107
+ // restart never re-adopts one. Loaded before the stored session is trusted.
108
+ const tombstoneStore = config.tombstoneStore ??
109
+ (plugins.Preferences ? (0, token_store_1.createPreferencesTombstoneStore)(plugins.Preferences) : undefined);
110
+ const guard = new js_1.SignOutGuard({
111
+ // Every revoke passes its own session-bound request; this one carries none.
112
+ request: (path, init) => doFetch(`${frontendApi}${path}`, {
113
+ ...init,
114
+ headers: { 'x-publishable-key': config.publishableKey, ...init?.headers },
115
+ }),
116
+ frontendApi,
117
+ ...(tombstoneStore ? { store: tombstoneStore } : {}),
118
+ ...(config.signOutRetryDelaysMs ? { retryDelaysMs: config.signOutRetryDelaysMs } : {}),
119
+ });
120
+ await guard.ready;
80
121
  const manager = await (0, native_session_1.createNativeSessionManager)({
81
122
  frontendApi,
82
123
  publishableKey: config.publishableKey,
@@ -84,7 +125,20 @@ async function createAtlasCapacitor(config) {
84
125
  storage,
85
126
  fetchImpl: config.fetchImpl,
86
127
  now: config.now,
128
+ // Never adopt (nor write back) a session this app signed out of; a stored
129
+ // one is revoked again in the background, as itself.
130
+ refuse: (session) => guard.isSignedOut(session.sessionId) && guard.refuse(session.sessionId, sessionBoundRequest(session)),
87
131
  });
132
+ // A refresh still in flight at sign-out must not put the session back in memory.
133
+ manager.onChange((session) => {
134
+ if (guard.isSignedOut(session.sessionId))
135
+ manager.clear();
136
+ });
137
+ const getToken = async () => {
138
+ const token = await manager.getToken();
139
+ // Signed out while a refresh was in flight: the rotated token is not ours.
140
+ return token && manager.current ? token : null;
141
+ };
88
142
  const requireString = (value, name) => {
89
143
  if (!value)
90
144
  throw new Error(`Atlas: \`${name}\` is required to sign in.`);
@@ -132,25 +186,47 @@ async function createAtlasCapacitor(config) {
132
186
  manager.setSession(session);
133
187
  return session;
134
188
  },
135
- async signOut() {
189
+ async signOut(options = {}) {
190
+ const session = manager.current;
191
+ // Tombstones the session synchronously, before anything below can yield;
192
+ // the revoke itself rides on the session being dropped.
193
+ const pending = session
194
+ ? guard.revoke(session.sessionId, { ...options, request: sessionBoundRequest(session) })
195
+ : null;
136
196
  manager.clear();
137
- await (0, native_session_1.clearNativeSession)(storage);
197
+ // The tombstone already keeps a restart from re-adopting a session this
198
+ // clear fails to remove, so a store error does not fail the sign-out.
199
+ await Promise.resolve()
200
+ .then(() => (0, native_session_1.clearNativeSession)(storage))
201
+ .catch(() => undefined);
202
+ // Nothing to revoke when signed out (a bearer client has no cookie to find one by).
203
+ const attempt = pending ? await pending : { sessionId: null, outcome: { revoked: true, status: 200 } };
204
+ // A promoted session (`activeSessionId`) comes with cookies only — the
205
+ // bearer revoke never hands this client a credential for it — so it is
206
+ // reported, not adopted.
207
+ return guard.settle(attempt, options);
138
208
  },
139
- getToken() {
140
- return manager.getToken();
141
- },
142
- authHeaders() {
143
- return manager.authHeaders();
209
+ getToken,
210
+ async authHeaders() {
211
+ const token = await getToken();
212
+ return token
213
+ ? { Authorization: `Bearer ${token}`, 'x-publishable-key': config.publishableKey }
214
+ : { 'x-publishable-key': config.publishableKey };
144
215
  },
145
216
  getSession() {
146
217
  return manager.current;
147
218
  },
148
219
  onChange(listener) {
149
- return manager.onChange(listener);
220
+ return manager.onChange((session) => {
221
+ if (!guard.isSignedOut(session.sessionId))
222
+ listener(session);
223
+ });
150
224
  },
151
225
  };
152
226
  }
153
227
  // ── Re-exports: the pieces, for apps that drive the flow themselves ──────────
228
+ var js_2 = require("@atlasauth/js");
229
+ Object.defineProperty(exports, "SignOutError", { enumerable: true, get: function () { return js_2.SignOutError; } });
154
230
  __exportStar(require("./plugins"), exports);
155
231
  __exportStar(require("./pkce"), exports);
156
232
  __exportStar(require("./token-store"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;AAiHH,oDAsGC;AArND,sCAAkG;AAClG,uCAImB;AACnB,uCAKmB;AACnB,+CAKuB;AACvB,qDAAkF;AAyElF;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAkC;IAElC,yEAAyE;IACzE,4EAA4E;IAC5E,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,WAAW,GAAG,IAAA,uBAAkB,EAAC,MAAM,CAAC,WAAW,EAAE;QACzD,SAAS,EAAE,wBAAwB;QACnC,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,IAAA,8BAAoB,GAAE,CAAC,CAAC;IAEjE,MAAM,OAAO,GACX,MAAM,CAAC,OAAO;QACd,CAAC,OAAO,CAAC,WAAW;YAClB,CAAC,CAAC,IAAA,yCAA2B,EAAC,OAAO,CAAC,WAAW,EAAE,iCAAmB,CAAC;YACvE,CAAC,CAAC,IAAA,sCAAwB,GAAE,CAAC,CAAC;IAElC,MAAM,SAAS,GACb,MAAM,CAAC,SAAS;QAChB,CA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AAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA"}
@@ -12,7 +12,7 @@
12
12
  * session id the refresh call needs and the current JWT. Give the native session
13
13
  * its OWN store/key, separate from any other value the app keeps.
14
14
  */
15
- import { NativeSessionManager } from '@atlasauth/js';
15
+ import { NativeSessionManager, type NativeSession } from '@atlasauth/js';
16
16
  import { type TokenStore } from './token-store';
17
17
  export interface NativeSessionConfig {
18
18
  /** The instance's FAPI origin, e.g. `https://fapi.acme.atlasauth.net`. */
@@ -31,6 +31,14 @@ export interface NativeSessionConfig {
31
31
  fetchImpl?: typeof fetch;
32
32
  /** Injectable clock, epoch ms. Defaults to `Date.now`. */
33
33
  now?: () => number;
34
+ /**
35
+ * Asked before a session is adopted from the store on boot, and before a
36
+ * (rotated) session is persisted. Return true for a session the app signed
37
+ * out of: it is not seeded (and is cleared from the store), nor written back
38
+ * by a refresh that was still in flight at sign-out. `createAtlasCapacitor`
39
+ * wires this to its `SignOutGuard`.
40
+ */
41
+ refuse?: (session: NativeSession) => boolean;
34
42
  }
35
43
  /**
36
44
  * Build a {@link NativeSessionManager} wired to a Capacitor token store.
@@ -35,7 +35,15 @@ async function createNativeSessionManager(config) {
35
35
  allowSameOrigin: false,
36
36
  });
37
37
  const storage = config.storage ?? (0, token_store_1.createInMemoryTokenStore)();
38
- const initial = (0, js_1.parseNativeSession)(await storage.getToken()) ?? undefined;
38
+ let initial = (0, js_1.parseNativeSession)(await storage.getToken()) ?? undefined;
39
+ if (initial && config.refuse?.(initial)) {
40
+ // A session this app signed out of (the clear never landed, or a refresh
41
+ // in flight at sign-out wrote it back): boot signed out.
42
+ initial = undefined;
43
+ await Promise.resolve()
44
+ .then(() => storage.clearToken())
45
+ .catch(() => undefined);
46
+ }
39
47
  return new js_1.NativeSessionManager({
40
48
  baseUrl,
41
49
  publishableKey: config.publishableKey,
@@ -47,6 +55,8 @@ async function createNativeSessionManager(config) {
47
55
  // the rotated refresh token survives an app restart. Fire-and-forget — the
48
56
  // store may be async, and a write failure must not break the live session.
49
57
  persist: (session) => {
58
+ if (config.refuse?.(session))
59
+ return;
50
60
  void Promise.resolve(storage.setToken((0, js_1.serializeNativeSession)(session))).catch(() => undefined);
51
61
  },
52
62
  });
@@ -1 +1 @@
1
- {"version":3,"file":"native-session.js","sourceRoot":"","sources":["../src/native-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAsCH,gEA4BC;AAGD,gDAEC;AArED,sCAMuB;AACvB,+CAA0E;AAqB1E;;;;;;;GAOG;AACI,KAAK,UAAU,0BAA0B,CAC9C,MAA2B;IAE3B,2EAA2E;IAC3E,sCAAsC;IACtC,MAAM,OAAO,GAAG,IAAA,uBAAkB,EAAC,MAAM,CAAC,WAAW,EAAE;QACrD,SAAS,EAAE,8BAA8B;QACzC,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,IAAA,sCAAwB,GAAE,CAAC;IAC7D,MAAM,OAAO,GAAG,IAAA,uBAAkB,EAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,SAAS,CAAC;IAE1E,OAAO,IAAI,yBAAoB,CAAC;QAC9B,OAAO;QACP,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO;QACP,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,2EAA2E;QAC3E,2EAA2E;QAC3E,2EAA2E;QAC3E,OAAO,EAAE,CAAC,OAAsB,EAAE,EAAE;YAClC,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAA,2BAAsB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAC3E,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;QACJ,CAAC;KACF,CAAC,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,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,2EAA2E;QAC3E,2EAA2E;QAC3E,2EAA2E;QAC3E,OAAO,EAAE,CAAC,OAAsB,EAAE,EAAE;YAClC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;gBAAE,OAAO;YACrC,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAA,2BAAsB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAC3E,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,qDAAqD;AAC9C,KAAK,UAAU,kBAAkB,CAAC,OAAmB;IAC1D,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED,oCAKuB;AAJrB,0GAAA,oBAAoB,OAAA;AACpB,wGAAA,kBAAkB,OAAA;AAClB,0GAAA,oBAAoB,OAAA"}
@@ -20,6 +20,7 @@
20
20
  * `capacitor-secure-storage-plugin` — behind this same {@link TokenStore}
21
21
  * interface. See {@link createPreferencesTokenStore} for the drop-in shape.
22
22
  */
23
+ import type { TombstoneStore } from '@atlasauth/js';
23
24
  import type { PreferencesPlugin } from './plugins';
24
25
  /**
25
26
  * A single-slot token store: read, write, clear one string value. This is the
@@ -61,3 +62,16 @@ export declare function createPreferencesTokenStore(preferences: PreferencesPlug
61
62
  * adapter) in production.
62
63
  */
63
64
  export declare function createInMemoryTokenStore(): TokenStore;
65
+ /**
66
+ * A {@link TombstoneStore} over `@capacitor/preferences` — where the ids of the
67
+ * sessions this app signed out of are kept, so a restart never re-adopts one
68
+ * (see `SignOutGuard` in `@atlasauth/js`). The default when the plugin is
69
+ * present. Tombstones are session ids, never credentials, so plaintext is fine.
70
+ */
71
+ export declare function createPreferencesTombstoneStore(preferences: PreferencesPlugin): TombstoneStore;
72
+ /**
73
+ * Adapt a single-slot {@link TokenStore} (e.g. a secure-storage-backed one) to
74
+ * a {@link TombstoneStore}. Give it its OWN slot — never the session's: the
75
+ * key `SignOutGuard` asks for is ignored, every read and write hits that slot.
76
+ */
77
+ export declare function tombstoneStoreFromTokenStore(store: TokenStore): TombstoneStore;
@@ -25,6 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.DEFAULT_SESSION_KEY = void 0;
26
26
  exports.createPreferencesTokenStore = createPreferencesTokenStore;
27
27
  exports.createInMemoryTokenStore = createInMemoryTokenStore;
28
+ exports.createPreferencesTombstoneStore = createPreferencesTombstoneStore;
29
+ exports.tombstoneStoreFromTokenStore = tombstoneStoreFromTokenStore;
28
30
  /** The default key the serialized native session is stored under. */
29
31
  exports.DEFAULT_SESSION_KEY = 'atlas.native_session';
30
32
  /**
@@ -67,4 +69,27 @@ function createInMemoryTokenStore() {
67
69
  },
68
70
  };
69
71
  }
72
+ /**
73
+ * A {@link TombstoneStore} over `@capacitor/preferences` — where the ids of the
74
+ * sessions this app signed out of are kept, so a restart never re-adopts one
75
+ * (see `SignOutGuard` in `@atlasauth/js`). The default when the plugin is
76
+ * present. Tombstones are session ids, never credentials, so plaintext is fine.
77
+ */
78
+ function createPreferencesTombstoneStore(preferences) {
79
+ return {
80
+ getItem: async (key) => (await preferences.get({ key })).value ?? null,
81
+ setItem: (key, value) => preferences.set({ key, value }),
82
+ };
83
+ }
84
+ /**
85
+ * Adapt a single-slot {@link TokenStore} (e.g. a secure-storage-backed one) to
86
+ * a {@link TombstoneStore}. Give it its OWN slot — never the session's: the
87
+ * key `SignOutGuard` asks for is ignored, every read and write hits that slot.
88
+ */
89
+ function tombstoneStoreFromTokenStore(store) {
90
+ return {
91
+ getItem: () => store.getToken(),
92
+ setItem: (_key, value) => store.setToken(value),
93
+ };
94
+ }
70
95
  //# sourceMappingURL=token-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-store.js","sourceRoot":"","sources":["../src/token-store.ts"],"names":[],"mappings":";AAAA;;;;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
1
  {
2
2
  "name": "@atlasauth/capacitor",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -11,7 +11,7 @@
11
11
  "./package.json": "./package.json"
12
12
  },
13
13
  "dependencies": {
14
- "@atlasauth/js": "0.6.0"
14
+ "@atlasauth/js": "0.8.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@capacitor/core": ">=6",