@atlasauth/svelte 0.11.0 → 0.12.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,9 @@
1
1
  # @atlasauth/svelte changelog
2
2
 
3
+ ## 0.12.0 — 2026-10-28
4
+
5
+ - `ManageCiba` component lists sign-in approvals (approve or deny) and manages the CIBA PIN; mounted in the user profile.
6
+
3
7
  ## 0.11.0 — 2026-10-24
4
8
 
5
9
  - Integrator platform release: see the Atlas changelog for 2026-10-24.
@@ -0,0 +1,78 @@
1
+ <script>import { onMount } from "svelte";
2
+ import {
3
+ clearCibaPin,
4
+ decideCibaRequest,
5
+ getCibaPin,
6
+ listCibaRequests,
7
+ setCibaPin
8
+ } from "@atlasauth/js";
9
+ import { useAtlas } from "../context";
10
+ import { classFor } from "../appearance";
11
+ import { FapiClient } from "../fapi";
12
+ import { ATLAS_SVELTE_SDK } from "../version";
13
+ const atlas = useAtlas();
14
+ const client = new FapiClient({
15
+ publishableKey: atlas.publishableKey,
16
+ baseUrl: atlas.frontendApi,
17
+ locale: atlas.locale,
18
+ sdk: ATLAS_SVELTE_SDK
19
+ });
20
+ let requests = [];
21
+ let pin = null;
22
+ let newPin = "";
23
+ let password = "";
24
+ let message = null;
25
+ async function load() {
26
+ const [r, p] = await Promise.all([listCibaRequests(client).catch(() => []), getCibaPin(client).catch(() => null)]);
27
+ requests = r;
28
+ pin = p;
29
+ }
30
+ onMount(load);
31
+ async function run(fn, fallback) {
32
+ message = null;
33
+ try {
34
+ await fn();
35
+ newPin = "";
36
+ password = "";
37
+ await load();
38
+ } catch (e) {
39
+ message = e instanceof Error && e.message ? e.message : fallback;
40
+ }
41
+ }
42
+ $: cardClass = classFor("card", atlas.appearance, "atlas-card");
43
+ $: buttonClass = classFor("formButtonSecondary", atlas.appearance, "atlas-button-secondary");
44
+ </script>
45
+
46
+ {#if requests.length || (pin && (pin.set || pin.available))}
47
+ <section class={cardClass} data-atlas="manage-ciba">
48
+ {#if requests.length}
49
+ <h2>Sign-in requests from apps</h2>
50
+ <ul>
51
+ {#each requests as r (r.id)}
52
+ <li>
53
+ <strong>{r.client_name}</strong>
54
+ {#if r.binding_message}<div>{r.binding_message}</div>{/if}
55
+ <small>{r.scope.join(', ')}</small>
56
+ <button class={buttonClass} type="button" on:click={() => void run(() => decideCibaRequest(client, r.id, 'approve'), 'Could not approve.')}>Approve</button>
57
+ <button class={buttonClass} type="button" on:click={() => void run(() => decideCibaRequest(client, r.id, 'deny'), 'Could not deny.')}>Deny</button>
58
+ </li>
59
+ {/each}
60
+ </ul>
61
+ {/if}
62
+ {#if pin && (pin.set || pin.available)}
63
+ <form on:submit|preventDefault={() => void run(() => setCibaPin(client, { pin: newPin, currentPassword: password }), 'Could not save the PIN.')}>
64
+ <h2>CIBA PIN</h2>
65
+ <p>{pin.set ? 'You have a CIBA PIN.' : 'You have not set a CIBA PIN.'} Apps that start a sign-in request for you must send it.</p>
66
+ <input type="password" autocomplete="current-password" placeholder="Current password" aria-label="Current password" bind:value={password} />
67
+ <input type="password" inputmode="numeric" autocomplete="off" placeholder="6 to 12 digits" aria-label="New CIBA PIN" bind:value={newPin} />
68
+ <button class={buttonClass} type="submit">{pin.set ? 'Change PIN' : 'Set PIN'}</button>
69
+ {#if pin.set}
70
+ <button class={buttonClass} type="button" on:click={() => void run(() => clearCibaPin(client, { currentPassword: password }), 'Could not remove the PIN.')}>Remove PIN</button>
71
+ {/if}
72
+ {#if message}<small role="status">{message}</small>{/if}
73
+ </form>
74
+ {:else if message}
75
+ <small role="status">{message}</small>
76
+ {/if}
77
+ </section>
78
+ {/if}
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: Record<string, never>;
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {};
8
+ exports?: {} | undefined;
9
+ bindings?: string | undefined;
10
+ };
11
+ export type ManageCibaProps = typeof __propDef.props;
12
+ export type ManageCibaEvents = typeof __propDef.events;
13
+ export type ManageCibaSlots = typeof __propDef.slots;
14
+ export default class ManageCiba extends SvelteComponent<ManageCibaProps, ManageCibaEvents, ManageCibaSlots> {
15
+ }
16
+ export {};
@@ -4,6 +4,7 @@ import { classFor } from "../appearance";
4
4
  import { translate } from "../i18n";
5
5
  import { FapiClient } from "../fapi";
6
6
  import { ATLAS_SVELTE_SDK } from "../version";
7
+ import ManageCiba from "./ManageCiba.svelte";
7
8
  const atlas = useAtlas();
8
9
  const user = getUser();
9
10
  const t = (key) => translate(atlas.catalog, key);
@@ -91,5 +92,7 @@ $: buttonClass = classFor("formButtonSecondary", atlas.appearance, "atlas-button
91
92
  <h2>{t('userProfile.securitySection')}</h2>
92
93
  <p>{current.mfa_enabled ? '2FA on' : '2FA off'}</p>
93
94
  </section>
95
+
96
+ <ManageCiba />
94
97
  </div>
95
98
  {/if}
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export { default as SignIn } from './components/SignIn.svelte';
27
27
  export { default as SignUp } from './components/SignUp.svelte';
28
28
  export { default as UserButton } from './components/UserButton.svelte';
29
29
  export { default as UserProfile } from './components/UserProfile.svelte';
30
+ export { default as ManageCiba } from './components/ManageCiba.svelte';
30
31
  export { default as OrganizationSwitcher } from './components/OrganizationSwitcher.svelte';
31
32
  export { default as OrganizationProfile } from './components/OrganizationProfile.svelte';
32
33
  export { default as OrganizationAuditLog } from './components/OrganizationAuditLog.svelte';
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ export { default as SignIn } from './components/SignIn.svelte';
31
31
  export { default as SignUp } from './components/SignUp.svelte';
32
32
  export { default as UserButton } from './components/UserButton.svelte';
33
33
  export { default as UserProfile } from './components/UserProfile.svelte';
34
+ export { default as ManageCiba } from './components/ManageCiba.svelte';
34
35
  export { default as OrganizationSwitcher } from './components/OrganizationSwitcher.svelte';
35
36
  export { default as OrganizationProfile } from './components/OrganizationProfile.svelte';
36
37
  export { default as OrganizationAuditLog } from './components/OrganizationAuditLog.svelte';
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { AtlasSdkInfo } from '@atlasauth/js';
2
2
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
3
- export declare const ATLAS_SVELTE_VERSION = "0.10.0";
3
+ export declare const ATLAS_SVELTE_VERSION = "0.11.0";
4
4
  export declare const ATLAS_SVELTE_SDK: AtlasSdkInfo;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
2
- export const ATLAS_SVELTE_VERSION = '0.10.0';
2
+ export const ATLAS_SVELTE_VERSION = '0.11.0';
3
3
  export const ATLAS_SVELTE_SDK = { name: '@atlasauth/svelte', version: ATLAS_SVELTE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasauth/svelte",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "svelte": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@atlasauth/design": "0.3.0",
26
- "@atlasauth/backend": "0.19.0",
27
- "@atlasauth/js": "0.20.0",
28
- "@atlasauth/authz": "0.2.0"
26
+ "@atlasauth/js": "0.26.1",
27
+ "@atlasauth/authz": "0.3.0",
28
+ "@atlasauth/backend": "0.27.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "svelte": ">=4",