@atlasauth/expo 0.9.0 → 0.10.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,15 @@
1
1
  # @atlasauth/expo changelog
2
2
 
3
+ ## 0.9.0 — 2026-11-14
4
+
5
+ - `useSignInScreen()` and `useSecuritySection(kind)` drive your own native sign-in and account-security screens, with step-up handled inside.
6
+
7
+ ## 0.8.0 — 2026-11-14
8
+
9
+ - `useStepUp()` / `withStepUp(fn)` re-verify the bearer session with the factors the account holds (passkey through `@atlasauth/expo-passkeys`) and retry the wrapped call.
10
+ - `useAccountSecurity` / `createAccountSecurityActions` carry the security-page helpers from `@atlasauth/js`.
11
+ - New entry `@atlasauth/expo/account-security`: no React Native import, `sideEffects: false`, usable in plain Node.
12
+
3
13
  ## 0.7.0 — 2026-11-13
4
14
 
5
15
  - `useAccountSecurity` / `createAccountSecurityActions` add `revokeAllTrustedDevices`.
@@ -20,6 +30,12 @@
20
30
 
21
31
  ## Unreleased
22
32
 
33
+ ## 0.10.0 — 2026-11-14
34
+
35
+ - `usePushDevices()` registers a phone for "Approve in your app" without enrolling push as a second factor.
36
+ - `useStepUp` offers a texted code (`phone_code`) when the account has a verified phone.
37
+ - Requires `@atlasauth/js` 0.44.0 or later.
38
+
23
39
  ### Added
24
40
 
25
41
  - `useAppApproval(id)`: approve-in-your-app for the signed-in app. Reads the pending request, polls while it is pending, and offers `approve(number)` and `deny()` with the shuffled number choices.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './policies';
7
7
  export * from './social';
8
8
  export * from './bridge';
9
9
  export * from './app-approval';
10
+ export * from './push-devices';
10
11
  export * from './account-security';
11
12
  export { getCaptchaToken, solveAtlasChallengeNative, atlasHeadlessCaptchaSolver, installAtlasCaptchaSolver, type SolveCaptchaOptions, type GetCaptchaTokenOptions, } from '@atlasauth/react-native';
12
13
  export * from './account-security-hook';
package/dist/index.js CHANGED
@@ -50,6 +50,7 @@ __exportStar(require("./policies"), exports);
50
50
  __exportStar(require("./social"), exports);
51
51
  __exportStar(require("./bridge"), exports);
52
52
  __exportStar(require("./app-approval"), exports);
53
+ __exportStar(require("./push-devices"), exports);
53
54
  __exportStar(require("./account-security"), exports);
54
55
  // Captcha with no browser: the proof-of-work solver for Hermes/JSC. Importing this
55
56
  // package installs it as the headless solver, so the sign-in / sign-up / reset
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2EAA2E;AAC3E,kEAAkE;AAClE,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAEhC,8EAA8E;AAC9E,mDAAiC;AAEjC;;;;;;;;;;GAUG;AACH,0CAW0B;AAVxB,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,iGAAA,QAAQ,OAAA;AACR,kGAAA,SAAS,OAAA;AACT,gGAAA,OAAO,OAAA;AACP,qGAAA,YAAY,OAAA;AACZ,oGAAA,WAAW,OAAA;AAGb,oGAAoG;AACpG,6CAA2B;AAE3B,mGAAmG;AACnG,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,qDAAmC;AAEnC,mFAAmF;AACnF,+EAA+E;AAC/E,4DAA4D;AAC5D,wDAOiC;AAN/B,+GAAA,eAAe,OAAA;AACf,yHAAA,yBAAyB,OAAA;AACzB,0HAAA,0BAA0B,OAAA;AAC1B,yHAAA,yBAAyB,OAAA;AAI3B,0DAAwC;AACxC,4CAA0B;AAE1B,8GAA8G;AAC9G,4CAA0B;AAC1B,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2EAA2E;AAC3E,kEAAkE;AAClE,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAEhC,8EAA8E;AAC9E,mDAAiC;AAEjC;;;;;;;;;;GAUG;AACH,0CAW0B;AAVxB,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,iGAAA,QAAQ,OAAA;AACR,kGAAA,SAAS,OAAA;AACT,gGAAA,OAAO,OAAA;AACP,qGAAA,YAAY,OAAA;AACZ,oGAAA,WAAW,OAAA;AAGb,oGAAoG;AACpG,6CAA2B;AAE3B,mGAAmG;AACnG,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,iDAA+B;AAC/B,qDAAmC;AAEnC,mFAAmF;AACnF,+EAA+E;AAC/E,4DAA4D;AAC5D,wDAOiC;AAN/B,+GAAA,eAAe,OAAA;AACf,yHAAA,yBAAyB,OAAA;AACzB,0HAAA,0BAA0B,OAAA;AAC1B,yHAAA,yBAAyB,OAAA;AAI3B,0DAAwC;AACxC,4CAA0B;AAE1B,8GAA8G;AAC9G,4CAA0B;AAC1B,iDAA+B"}
@@ -0,0 +1,35 @@
1
+ import { type FapiClient, type PendingPushDevice, type PushDevice } from '@atlasauth/js';
2
+ export interface PushDevicesController {
3
+ /** The device just registered, awaiting its number. Show `pending.number` to the person. */
4
+ pending: PendingPushDevice | null;
5
+ error: string | null;
6
+ /** Register an Expo (or native) push token for approvals only. */
7
+ register(input: {
8
+ deviceToken: string;
9
+ platform: PushDevice['platform'];
10
+ label?: string;
11
+ }): Promise<boolean>;
12
+ /** Confirm with the number the person tapped. */
13
+ confirm(number: string): Promise<boolean>;
14
+ list(): Promise<PushDevice[]>;
15
+ remove(id: string): Promise<boolean>;
16
+ }
17
+ /** Controller logic, separated from React so it is testable with a fake client. */
18
+ export declare function createPushDeviceActions(client: FapiClient): {
19
+ register: (input: {
20
+ deviceToken: string;
21
+ platform: PushDevice["platform"];
22
+ label?: string;
23
+ }) => Promise<{
24
+ pending: PendingPushDevice | null;
25
+ response: import("@atlasauth/js").FapiResponse<import("@atlasauth/js").PushDeviceWire & {
26
+ challenge_id: string;
27
+ number_match: string;
28
+ expires_at: number;
29
+ }>;
30
+ }>;
31
+ confirm: (challengeId: string, number: string) => Promise<boolean>;
32
+ list: () => Promise<PushDevice[]>;
33
+ remove: (id: string) => Promise<boolean>;
34
+ };
35
+ export declare function usePushDevices(): PushDevicesController;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPushDeviceActions = createPushDeviceActions;
4
+ exports.usePushDevices = usePushDevices;
5
+ /**
6
+ * Register this phone for "Approve in your app" pushes, without enrolling push
7
+ * as a second factor. A thin hook over the `@atlasauth/js` calls, bound to the
8
+ * provider's bearer-authenticated client.
9
+ */
10
+ const react_1 = require("react");
11
+ const js_1 = require("@atlasauth/js");
12
+ const policies_1 = require("./policies");
13
+ /** Controller logic, separated from React so it is testable with a fake client. */
14
+ function createPushDeviceActions(client) {
15
+ return {
16
+ register: (input) => (0, js_1.registerApprovalDevice)(client, input),
17
+ confirm: async (challengeId, number) => (await (0, js_1.respondToPushDevice)(client, { challengeId, number })).ok,
18
+ list: () => (0, js_1.listPushDevices)(client),
19
+ remove: async (id) => (await (0, js_1.removePushDevice)(client, id)).ok,
20
+ };
21
+ }
22
+ function usePushDevices() {
23
+ const client = (0, policies_1.useExpoFapiClient)();
24
+ const [pending, setPending] = (0, react_1.useState)(null);
25
+ const [error, setError] = (0, react_1.useState)(null);
26
+ const actions = createPushDeviceActions(client);
27
+ const register = (0, react_1.useCallback)(async (input) => {
28
+ const { pending: next, response } = await createPushDeviceActions(client).register(input);
29
+ setPending(next);
30
+ setError(next ? null : (response.errors[0]?.message ?? 'The device could not be registered.'));
31
+ return next !== null;
32
+ }, [client]);
33
+ const confirm = (0, react_1.useCallback)(async (number) => {
34
+ if (!pending)
35
+ return false;
36
+ const ok = await createPushDeviceActions(client).confirm(pending.challengeId, number);
37
+ setError(ok ? null : 'The number was not accepted.');
38
+ if (ok)
39
+ setPending(null);
40
+ return ok;
41
+ }, [client, pending]);
42
+ return { pending, error, register, confirm, list: actions.list, remove: actions.remove };
43
+ }
44
+ //# sourceMappingURL=push-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-devices.js","sourceRoot":"","sources":["../src/push-devices.ts"],"names":[],"mappings":";;AAsBA,0DAOC;AAED,wCAsBC;AArDD;;;;GAIG;AACH,iCAA8C;AAC9C,sCAAyK;AACzK,yCAA+C;AAc/C,mFAAmF;AACnF,SAAgB,uBAAuB,CAAC,MAAkB;IACxD,OAAO;QACL,QAAQ,EAAE,CAAC,KAAgF,EAAE,EAAE,CAAC,IAAA,2BAAsB,EAAC,MAAM,EAAE,KAAK,CAAC;QACrI,OAAO,EAAE,KAAK,EAAE,WAAmB,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,IAAA,wBAAmB,EAAC,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;QACvH,IAAI,EAAE,GAAG,EAAE,CAAC,IAAA,oBAAe,EAAC,MAAM,CAAC;QACnC,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,MAAM,IAAA,qBAAgB,EAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;KACtE,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc;IAC5B,MAAM,MAAM,GAAG,IAAA,4BAAiB,GAAE,CAAC;IACnC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAA2B,IAAI,CAAC,CAAC;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEhD,MAAM,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"./dist/index.d.ts",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "@atlasauth/react-native": "^0.8.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@atlasauth/js": ">=0.43.0 <1.0.0",
32
+ "@atlasauth/js": ">=0.44.0 <1.0.0",
33
33
  "react": ">=18",
34
34
  "react-native": ">=0.73",
35
35
  "expo-secure-store": ">=12",
@@ -58,7 +58,7 @@
58
58
  "react": "^18.3.1",
59
59
  "typescript": "^5.6.3",
60
60
  "vitest": "^3.2.7",
61
- "@atlasauth/js": "0.43.0"
61
+ "@atlasauth/js": "0.44.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"