@authyon/auth 0.2.0-beta.16 → 0.2.0-beta.19

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/README.md CHANGED
@@ -216,14 +216,15 @@ Métodos de sessão/auth ficam soltos no client; os que giram em torno de um rec
216
216
 
217
217
  ### `authyon.user`
218
218
 
219
- | Método | Endpoint |
220
- | ----------------------------------------------- | ----------------------------------- |
221
- | `user.me()` | `GET /auth/me` |
222
- | `user.sessions()` | `GET /auth/sessions` |
223
- | `user.revokeSession(sessionId)` | `DELETE /auth/sessions/{id}` |
224
- | `user.activities(params?)` | `GET /auth/me/activities` |
225
- | `user.requestPasswordReset(email)` | `POST /auth/password-reset/request` |
226
- | `user.confirmPasswordReset(token, newPassword)` | `POST /auth/password-reset/confirm` |
219
+ | Método | Endpoint |
220
+ | ----------------------------------------------- | ------------------------------------ |
221
+ | `user.me()` | `GET /auth/me` |
222
+ | `user.sessions()` | `GET /auth/sessions` |
223
+ | `user.revokeSession(sessionId)` | `DELETE /auth/sessions/{id}` |
224
+ | `user.activities(params?)` | `GET /auth/me/activities` |
225
+ | `user.requestPasswordReset(email, options?)` | `POST /auth/password-reset/request` |
226
+ | `user.validatePasswordReset(token)` | `POST /auth/password-reset/validate` |
227
+ | `user.confirmPasswordReset(token, newPassword)` | `POST /auth/password-reset/confirm` |
227
228
 
228
229
  ### `authyon.organization`
229
230
 
@@ -164,10 +164,20 @@ interface PaginationOptions {
164
164
  skip?: number;
165
165
  take?: number;
166
166
  }
167
+ /**
168
+ * The envelope every paged endpoint answers with.
169
+ *
170
+ * `page` is the 1-based current page and `perPage` is how many items a page
171
+ * holds — the same sense `take` has on the way in. Up to Authyon API
172
+ * 2026-10-21 the two were named `perPage` (holding the page number) and
173
+ * `pageSize` (holding the limit), so reading them by their names gave the
174
+ * wrong value without failing. Clients on the older API see `page` undefined
175
+ * and `perPage` holding a page number.
176
+ */
167
177
  interface Paged<T> {
168
178
  data: T[];
169
- perPage?: number;
170
- pageSize: number;
179
+ page: number;
180
+ perPage: number;
171
181
  total: number;
172
182
  pages: number;
173
183
  hasNext: boolean;
@@ -281,6 +291,29 @@ interface OrganizationInvitePreview {
281
291
  /** Where the issuer asked to send the invitee after accepting, or `null`. */
282
292
  redirectUri: string | null;
283
293
  }
294
+ /** Options for POST /auth/password-reset/request. */
295
+ interface PasswordResetRequestOptions {
296
+ /**
297
+ * Where to send the person after they change the password. Must be
298
+ * registered exactly in the environment's redirect URIs (the same list SSO
299
+ * and magic link use); otherwise the request fails with
300
+ * `user.password_reset.redirect_uri.not_allowed`. Comes back on
301
+ * `validatePasswordReset` and `confirmPasswordReset`.
302
+ */
303
+ redirectUri?: string;
304
+ }
305
+ /** POST /auth/password-reset/validate — what a live reset token is for. */
306
+ interface PasswordResetPreview {
307
+ email: string;
308
+ expiresAt: string;
309
+ /** Where the reset was asked to end, or `null`. */
310
+ redirectUri: string | null;
311
+ }
312
+ /** POST /auth/password-reset/confirm — the password is changed. */
313
+ interface PasswordResetCompleted {
314
+ /** Where the reset was asked to end, or `null`. Navigating there is up to you. */
315
+ redirectUri: string | null;
316
+ }
284
317
  /** POST /auth/tenant-invites/accept — everything but `token` is ignored when the address already has an account. */
285
318
  interface AcceptOrganizationInviteInput {
286
319
  token: string;
@@ -616,10 +649,27 @@ declare class AuthyonClient {
616
649
  * the endpoint differs, override via a raw call to your own backend.
617
650
  */
618
651
  revokeSession: (sessionId: string) => Promise<void>;
619
- /** POST /auth/password-reset/request — always resolves (no account enumeration). */
620
- requestPasswordReset: (email: string) => Promise<void>;
621
- /** POST /auth/password-reset/confirm — sets a new password and revokes all refresh tokens. */
622
- confirmPasswordReset: (token: string, newPassword: string) => Promise<void>;
652
+ /**
653
+ * POST /auth/password-reset/request — resolves whether or not the address
654
+ * has an account (no account enumeration). `redirectUri` is where the
655
+ * person lands after changing the password; it must be one of the
656
+ * environment's registered redirect URIs, or the call rejects with
657
+ * `user.password_reset.redirect_uri.not_allowed`.
658
+ */
659
+ requestPasswordReset: (email: string, options?: PasswordResetRequestOptions) => Promise<void>;
660
+ /**
661
+ * POST /auth/password-reset/validate — checks a reset token without
662
+ * spending it, so the reset page can refuse a dead link before asking for
663
+ * a password. Rejects with `user.password_reset.invalid` (401) when the
664
+ * token is unknown, used or expired.
665
+ */
666
+ validatePasswordReset: (token: string) => Promise<PasswordResetPreview>;
667
+ /**
668
+ * POST /auth/password-reset/confirm — sets a new password and revokes all
669
+ * refresh tokens. Resolves with the `redirectUri` the reset was requested
670
+ * with (`null` when there was none); following it is up to the caller.
671
+ */
672
+ confirmPasswordReset: (token: string, newPassword: string) => Promise<PasswordResetCompleted>;
623
673
  };
624
674
  readonly organization: {
625
675
  /** GET /auth/tenants — filterable list of organization memberships. */
@@ -878,4 +928,4 @@ declare function hasPermissionGroup(source: AuthyonPermissionSource | readonly s
878
928
  /** Converts Authyon's `subject:action` permission strings to authorization rules. */
879
929
  declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
880
930
 
881
- export { type SessionInfo as $, AuthyonClient as A, type HttpLogger as B, type ConfirmApprovalInput as C, type InviteMemberInput as D, type LoginInput as E, FetchHttpAdapter as F, type LoginResult as G, type HttpAdapter as H, type IntrospectResult as I, type OrganizationInvite as J, type OrganizationInviteAccepted as K, LoggingHttpAdapter as L, type OrganizationInviteInput as M, type OrganizationInviteIssued as N, type Organization as O, type OrganizationInvitePreview as P, type OrganizationInviteStatus as Q, type OrganizationMember as R, type Paged as S, type TokenStorage as T, type PaginationOptions as U, type PermissionGroup as V, type RegisterInput as W, type Role as X, type SecurityMethods as Y, type Session as Z, type SessionControllerOptions as _, type HttpLoggerOptions as a, type SessionSnapshot as a0, type SessionSnapshotListener as a1, type SessionStatus as a2, type SsoProvider as a3, type SubjectApprovals as a4, type SubjectSecurity as a5, type TwoFactorChallenge as a6, type TwoFactorMethod as a7, type TwoFactorStatus as a8, type User as a9, type ValidateResult as aa, type VerifyTwoFactorInput as ab, type WebAuthnAssertion as ac, type WebAuthnCeremonyStart as ad, type WebAuthnCredential as ae, createAuthyonAbility as af, createAuthyonRules as ag, createClient as ah, hasPermission as ai, hasPermissionGroup as aj, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRule as e, type AbilitySubject as f, type AcceptOrganizationInviteInput as g, type Activity as h, type Approval as i, type ApprovalAssurance as j, type ApprovalPayload as k, type ApprovalStatus as l, type ApprovalWebAuthnOptions as m, type AuthEvent as n, type AuthState as o, type AuthStateListener as p, type AuthenticatorSetup as q, AuthyonAbility as r, AuthyonAbilityBuilder as s, type AuthyonAbilityOptions as t, type AuthyonClientOptions as u, type AuthyonPermissionSource as v, AuthyonSessionController as w, type CreateOrganizationInput as x, type HttpAdapterRequest as y, type HttpLogEvent as z };
931
+ export { type SecurityMethods as $, AuthyonClient as A, type HttpLogger as B, type ConfirmApprovalInput as C, type InviteMemberInput as D, type LoginInput as E, FetchHttpAdapter as F, type LoginResult as G, type HttpAdapter as H, type IntrospectResult as I, type OrganizationInvite as J, type OrganizationInviteAccepted as K, LoggingHttpAdapter as L, type OrganizationInviteInput as M, type OrganizationInviteIssued as N, type Organization as O, type OrganizationInvitePreview as P, type OrganizationInviteStatus as Q, type OrganizationMember as R, type Paged as S, type TokenStorage as T, type PaginationOptions as U, type PasswordResetCompleted as V, type PasswordResetPreview as W, type PasswordResetRequestOptions as X, type PermissionGroup as Y, type RegisterInput as Z, type Role as _, type HttpLoggerOptions as a, type Session as a0, type SessionControllerOptions as a1, type SessionInfo as a2, type SessionSnapshot as a3, type SessionSnapshotListener as a4, type SessionStatus as a5, type SsoProvider as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, type TwoFactorChallenge as a9, type TwoFactorMethod as aa, type TwoFactorStatus as ab, type User as ac, type ValidateResult as ad, type VerifyTwoFactorInput as ae, type WebAuthnAssertion as af, type WebAuthnCeremonyStart as ag, type WebAuthnCredential as ah, createAuthyonAbility as ai, createAuthyonRules as aj, createClient as ak, hasPermission as al, hasPermissionGroup as am, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRule as e, type AbilitySubject as f, type AcceptOrganizationInviteInput as g, type Activity as h, type Approval as i, type ApprovalAssurance as j, type ApprovalPayload as k, type ApprovalStatus as l, type ApprovalWebAuthnOptions as m, type AuthEvent as n, type AuthState as o, type AuthStateListener as p, type AuthenticatorSetup as q, AuthyonAbility as r, AuthyonAbilityBuilder as s, type AuthyonAbilityOptions as t, type AuthyonClientOptions as u, type AuthyonPermissionSource as v, AuthyonSessionController as w, type CreateOrganizationInput as x, type HttpAdapterRequest as y, type HttpLogEvent as z };
@@ -164,10 +164,20 @@ interface PaginationOptions {
164
164
  skip?: number;
165
165
  take?: number;
166
166
  }
167
+ /**
168
+ * The envelope every paged endpoint answers with.
169
+ *
170
+ * `page` is the 1-based current page and `perPage` is how many items a page
171
+ * holds — the same sense `take` has on the way in. Up to Authyon API
172
+ * 2026-10-21 the two were named `perPage` (holding the page number) and
173
+ * `pageSize` (holding the limit), so reading them by their names gave the
174
+ * wrong value without failing. Clients on the older API see `page` undefined
175
+ * and `perPage` holding a page number.
176
+ */
167
177
  interface Paged<T> {
168
178
  data: T[];
169
- perPage?: number;
170
- pageSize: number;
179
+ page: number;
180
+ perPage: number;
171
181
  total: number;
172
182
  pages: number;
173
183
  hasNext: boolean;
@@ -281,6 +291,29 @@ interface OrganizationInvitePreview {
281
291
  /** Where the issuer asked to send the invitee after accepting, or `null`. */
282
292
  redirectUri: string | null;
283
293
  }
294
+ /** Options for POST /auth/password-reset/request. */
295
+ interface PasswordResetRequestOptions {
296
+ /**
297
+ * Where to send the person after they change the password. Must be
298
+ * registered exactly in the environment's redirect URIs (the same list SSO
299
+ * and magic link use); otherwise the request fails with
300
+ * `user.password_reset.redirect_uri.not_allowed`. Comes back on
301
+ * `validatePasswordReset` and `confirmPasswordReset`.
302
+ */
303
+ redirectUri?: string;
304
+ }
305
+ /** POST /auth/password-reset/validate — what a live reset token is for. */
306
+ interface PasswordResetPreview {
307
+ email: string;
308
+ expiresAt: string;
309
+ /** Where the reset was asked to end, or `null`. */
310
+ redirectUri: string | null;
311
+ }
312
+ /** POST /auth/password-reset/confirm — the password is changed. */
313
+ interface PasswordResetCompleted {
314
+ /** Where the reset was asked to end, or `null`. Navigating there is up to you. */
315
+ redirectUri: string | null;
316
+ }
284
317
  /** POST /auth/tenant-invites/accept — everything but `token` is ignored when the address already has an account. */
285
318
  interface AcceptOrganizationInviteInput {
286
319
  token: string;
@@ -616,10 +649,27 @@ declare class AuthyonClient {
616
649
  * the endpoint differs, override via a raw call to your own backend.
617
650
  */
618
651
  revokeSession: (sessionId: string) => Promise<void>;
619
- /** POST /auth/password-reset/request — always resolves (no account enumeration). */
620
- requestPasswordReset: (email: string) => Promise<void>;
621
- /** POST /auth/password-reset/confirm — sets a new password and revokes all refresh tokens. */
622
- confirmPasswordReset: (token: string, newPassword: string) => Promise<void>;
652
+ /**
653
+ * POST /auth/password-reset/request — resolves whether or not the address
654
+ * has an account (no account enumeration). `redirectUri` is where the
655
+ * person lands after changing the password; it must be one of the
656
+ * environment's registered redirect URIs, or the call rejects with
657
+ * `user.password_reset.redirect_uri.not_allowed`.
658
+ */
659
+ requestPasswordReset: (email: string, options?: PasswordResetRequestOptions) => Promise<void>;
660
+ /**
661
+ * POST /auth/password-reset/validate — checks a reset token without
662
+ * spending it, so the reset page can refuse a dead link before asking for
663
+ * a password. Rejects with `user.password_reset.invalid` (401) when the
664
+ * token is unknown, used or expired.
665
+ */
666
+ validatePasswordReset: (token: string) => Promise<PasswordResetPreview>;
667
+ /**
668
+ * POST /auth/password-reset/confirm — sets a new password and revokes all
669
+ * refresh tokens. Resolves with the `redirectUri` the reset was requested
670
+ * with (`null` when there was none); following it is up to the caller.
671
+ */
672
+ confirmPasswordReset: (token: string, newPassword: string) => Promise<PasswordResetCompleted>;
623
673
  };
624
674
  readonly organization: {
625
675
  /** GET /auth/tenants — filterable list of organization memberships. */
@@ -878,4 +928,4 @@ declare function hasPermissionGroup(source: AuthyonPermissionSource | readonly s
878
928
  /** Converts Authyon's `subject:action` permission strings to authorization rules. */
879
929
  declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
880
930
 
881
- export { type SessionInfo as $, AuthyonClient as A, type HttpLogger as B, type ConfirmApprovalInput as C, type InviteMemberInput as D, type LoginInput as E, FetchHttpAdapter as F, type LoginResult as G, type HttpAdapter as H, type IntrospectResult as I, type OrganizationInvite as J, type OrganizationInviteAccepted as K, LoggingHttpAdapter as L, type OrganizationInviteInput as M, type OrganizationInviteIssued as N, type Organization as O, type OrganizationInvitePreview as P, type OrganizationInviteStatus as Q, type OrganizationMember as R, type Paged as S, type TokenStorage as T, type PaginationOptions as U, type PermissionGroup as V, type RegisterInput as W, type Role as X, type SecurityMethods as Y, type Session as Z, type SessionControllerOptions as _, type HttpLoggerOptions as a, type SessionSnapshot as a0, type SessionSnapshotListener as a1, type SessionStatus as a2, type SsoProvider as a3, type SubjectApprovals as a4, type SubjectSecurity as a5, type TwoFactorChallenge as a6, type TwoFactorMethod as a7, type TwoFactorStatus as a8, type User as a9, type ValidateResult as aa, type VerifyTwoFactorInput as ab, type WebAuthnAssertion as ac, type WebAuthnCeremonyStart as ad, type WebAuthnCredential as ae, createAuthyonAbility as af, createAuthyonRules as ag, createClient as ah, hasPermission as ai, hasPermissionGroup as aj, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRule as e, type AbilitySubject as f, type AcceptOrganizationInviteInput as g, type Activity as h, type Approval as i, type ApprovalAssurance as j, type ApprovalPayload as k, type ApprovalStatus as l, type ApprovalWebAuthnOptions as m, type AuthEvent as n, type AuthState as o, type AuthStateListener as p, type AuthenticatorSetup as q, AuthyonAbility as r, AuthyonAbilityBuilder as s, type AuthyonAbilityOptions as t, type AuthyonClientOptions as u, type AuthyonPermissionSource as v, AuthyonSessionController as w, type CreateOrganizationInput as x, type HttpAdapterRequest as y, type HttpLogEvent as z };
931
+ export { type SecurityMethods as $, AuthyonClient as A, type HttpLogger as B, type ConfirmApprovalInput as C, type InviteMemberInput as D, type LoginInput as E, FetchHttpAdapter as F, type LoginResult as G, type HttpAdapter as H, type IntrospectResult as I, type OrganizationInvite as J, type OrganizationInviteAccepted as K, LoggingHttpAdapter as L, type OrganizationInviteInput as M, type OrganizationInviteIssued as N, type Organization as O, type OrganizationInvitePreview as P, type OrganizationInviteStatus as Q, type OrganizationMember as R, type Paged as S, type TokenStorage as T, type PaginationOptions as U, type PasswordResetCompleted as V, type PasswordResetPreview as W, type PasswordResetRequestOptions as X, type PermissionGroup as Y, type RegisterInput as Z, type Role as _, type HttpLoggerOptions as a, type Session as a0, type SessionControllerOptions as a1, type SessionInfo as a2, type SessionSnapshot as a3, type SessionSnapshotListener as a4, type SessionStatus as a5, type SsoProvider as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, type TwoFactorChallenge as a9, type TwoFactorMethod as aa, type TwoFactorStatus as ab, type User as ac, type ValidateResult as ad, type VerifyTwoFactorInput as ae, type WebAuthnAssertion as af, type WebAuthnCeremonyStart as ag, type WebAuthnCredential as ah, createAuthyonAbility as ai, createAuthyonRules as aj, createClient as ak, hasPermission as al, hasPermissionGroup as am, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRule as e, type AbilitySubject as f, type AcceptOrganizationInviteInput as g, type Activity as h, type Approval as i, type ApprovalAssurance as j, type ApprovalPayload as k, type ApprovalStatus as l, type ApprovalWebAuthnOptions as m, type AuthEvent as n, type AuthState as o, type AuthStateListener as p, type AuthenticatorSetup as q, AuthyonAbility as r, AuthyonAbilityBuilder as s, type AuthyonAbilityOptions as t, type AuthyonClientOptions as u, type AuthyonPermissionSource as v, AuthyonSessionController as w, type CreateOrganizationInput as x, type HttpAdapterRequest as y, type HttpLogEvent as z };
package/dist/index.cjs CHANGED
@@ -565,13 +565,36 @@ var AuthyonClient = class {
565
565
  method: "DELETE",
566
566
  bearer: true
567
567
  }),
568
- /** POST /auth/password-reset/request — always resolves (no account enumeration). */
569
- requestPasswordReset: (email) => this.request("/auth/password-reset/request", { method: "POST", body: { email } }),
570
- /** POST /auth/password-reset/confirm — sets a new password and revokes all refresh tokens. */
571
- confirmPasswordReset: (token, newPassword) => this.request("/auth/password-reset/confirm", {
568
+ /**
569
+ * POST /auth/password-reset/request — resolves whether or not the address
570
+ * has an account (no account enumeration). `redirectUri` is where the
571
+ * person lands after changing the password; it must be one of the
572
+ * environment's registered redirect URIs, or the call rejects with
573
+ * `user.password_reset.redirect_uri.not_allowed`.
574
+ */
575
+ requestPasswordReset: (email, options = {}) => this.request("/auth/password-reset/request", {
572
576
  method: "POST",
573
- body: { token, newPassword }
574
- })
577
+ body: { email, ...options }
578
+ }),
579
+ /**
580
+ * POST /auth/password-reset/validate — checks a reset token without
581
+ * spending it, so the reset page can refuse a dead link before asking for
582
+ * a password. Rejects with `user.password_reset.invalid` (401) when the
583
+ * token is unknown, used or expired.
584
+ */
585
+ validatePasswordReset: (token) => this.request("/auth/password-reset/validate", { method: "POST", body: { token } }),
586
+ /**
587
+ * POST /auth/password-reset/confirm — sets a new password and revokes all
588
+ * refresh tokens. Resolves with the `redirectUri` the reset was requested
589
+ * with (`null` when there was none); following it is up to the caller.
590
+ */
591
+ confirmPasswordReset: async (token, newPassword) => {
592
+ const done = await this.request(
593
+ "/auth/password-reset/confirm",
594
+ { method: "POST", body: { token, newPassword } }
595
+ );
596
+ return { redirectUri: done?.redirectUri ?? null };
597
+ }
575
598
  };
576
599
  // ── Organization ─────────────────────────────────────────────────────────
577
600
  this.organization = {
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenStorage, H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonClient } from './ability-Cp8ir5Gr.cjs';
2
- export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRule, f as AbilitySubject, g as AcceptOrganizationInviteInput, h as Activity, i as Approval, j as ApprovalAssurance, k as ApprovalPayload, l as ApprovalStatus, m as ApprovalWebAuthnOptions, n as AuthEvent, o as AuthState, p as AuthStateListener, q as AuthenticatorSetup, r as AuthyonAbility, s as AuthyonAbilityBuilder, t as AuthyonAbilityOptions, u as AuthyonClientOptions, v as AuthyonPermissionSource, w as AuthyonSessionController, C as ConfirmApprovalInput, x as CreateOrganizationInput, F as FetchHttpAdapter, y as HttpAdapterRequest, z as HttpLogEvent, B as HttpLogger, I as IntrospectResult, D as InviteMemberInput, L as LoggingHttpAdapter, E as LoginInput, G as LoginResult, O as Organization, J as OrganizationInvite, K as OrganizationInviteAccepted, M as OrganizationInviteInput, N as OrganizationInviteIssued, P as OrganizationInvitePreview, Q as OrganizationInviteStatus, R as OrganizationMember, S as Paged, U as PaginationOptions, V as PermissionGroup, W as RegisterInput, X as Role, Y as SecurityMethods, Z as Session, _ as SessionControllerOptions, $ as SessionInfo, a0 as SessionSnapshot, a1 as SessionSnapshotListener, a2 as SessionStatus, a3 as SsoProvider, a4 as SubjectApprovals, a5 as SubjectSecurity, a6 as TwoFactorChallenge, a7 as TwoFactorMethod, a8 as TwoFactorStatus, a9 as User, aa as ValidateResult, ab as VerifyTwoFactorInput, ac as WebAuthnAssertion, ad as WebAuthnCeremonyStart, ae as WebAuthnCredential, af as createAuthyonAbility, ag as createAuthyonRules, ah as createClient, ai as hasPermission, aj as hasPermissionGroup } from './ability-Cp8ir5Gr.cjs';
1
+ import { T as TokenStorage, H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonClient } from './ability-BTcayvkM.cjs';
2
+ export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRule, f as AbilitySubject, g as AcceptOrganizationInviteInput, h as Activity, i as Approval, j as ApprovalAssurance, k as ApprovalPayload, l as ApprovalStatus, m as ApprovalWebAuthnOptions, n as AuthEvent, o as AuthState, p as AuthStateListener, q as AuthenticatorSetup, r as AuthyonAbility, s as AuthyonAbilityBuilder, t as AuthyonAbilityOptions, u as AuthyonClientOptions, v as AuthyonPermissionSource, w as AuthyonSessionController, C as ConfirmApprovalInput, x as CreateOrganizationInput, F as FetchHttpAdapter, y as HttpAdapterRequest, z as HttpLogEvent, B as HttpLogger, I as IntrospectResult, D as InviteMemberInput, L as LoggingHttpAdapter, E as LoginInput, G as LoginResult, O as Organization, J as OrganizationInvite, K as OrganizationInviteAccepted, M as OrganizationInviteInput, N as OrganizationInviteIssued, P as OrganizationInvitePreview, Q as OrganizationInviteStatus, R as OrganizationMember, S as Paged, U as PaginationOptions, V as PasswordResetCompleted, W as PasswordResetPreview, X as PasswordResetRequestOptions, Y as PermissionGroup, Z as RegisterInput, _ as Role, $ as SecurityMethods, a0 as Session, a1 as SessionControllerOptions, a2 as SessionInfo, a3 as SessionSnapshot, a4 as SessionSnapshotListener, a5 as SessionStatus, a6 as SsoProvider, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TwoFactorChallenge, aa as TwoFactorMethod, ab as TwoFactorStatus, ac as User, ad as ValidateResult, ae as VerifyTwoFactorInput, af as WebAuthnAssertion, ag as WebAuthnCeremonyStart, ah as WebAuthnCredential, ai as createAuthyonAbility, aj as createAuthyonRules, ak as createClient, al as hasPermission, am as hasPermissionGroup } from './ability-BTcayvkM.cjs';
3
3
 
4
4
  declare const ErrorCodes: {
5
5
  readonly Unknown: "unknown";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenStorage, H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonClient } from './ability-Cp8ir5Gr.js';
2
- export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRule, f as AbilitySubject, g as AcceptOrganizationInviteInput, h as Activity, i as Approval, j as ApprovalAssurance, k as ApprovalPayload, l as ApprovalStatus, m as ApprovalWebAuthnOptions, n as AuthEvent, o as AuthState, p as AuthStateListener, q as AuthenticatorSetup, r as AuthyonAbility, s as AuthyonAbilityBuilder, t as AuthyonAbilityOptions, u as AuthyonClientOptions, v as AuthyonPermissionSource, w as AuthyonSessionController, C as ConfirmApprovalInput, x as CreateOrganizationInput, F as FetchHttpAdapter, y as HttpAdapterRequest, z as HttpLogEvent, B as HttpLogger, I as IntrospectResult, D as InviteMemberInput, L as LoggingHttpAdapter, E as LoginInput, G as LoginResult, O as Organization, J as OrganizationInvite, K as OrganizationInviteAccepted, M as OrganizationInviteInput, N as OrganizationInviteIssued, P as OrganizationInvitePreview, Q as OrganizationInviteStatus, R as OrganizationMember, S as Paged, U as PaginationOptions, V as PermissionGroup, W as RegisterInput, X as Role, Y as SecurityMethods, Z as Session, _ as SessionControllerOptions, $ as SessionInfo, a0 as SessionSnapshot, a1 as SessionSnapshotListener, a2 as SessionStatus, a3 as SsoProvider, a4 as SubjectApprovals, a5 as SubjectSecurity, a6 as TwoFactorChallenge, a7 as TwoFactorMethod, a8 as TwoFactorStatus, a9 as User, aa as ValidateResult, ab as VerifyTwoFactorInput, ac as WebAuthnAssertion, ad as WebAuthnCeremonyStart, ae as WebAuthnCredential, af as createAuthyonAbility, ag as createAuthyonRules, ah as createClient, ai as hasPermission, aj as hasPermissionGroup } from './ability-Cp8ir5Gr.js';
1
+ import { T as TokenStorage, H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonClient } from './ability-BTcayvkM.js';
2
+ export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRule, f as AbilitySubject, g as AcceptOrganizationInviteInput, h as Activity, i as Approval, j as ApprovalAssurance, k as ApprovalPayload, l as ApprovalStatus, m as ApprovalWebAuthnOptions, n as AuthEvent, o as AuthState, p as AuthStateListener, q as AuthenticatorSetup, r as AuthyonAbility, s as AuthyonAbilityBuilder, t as AuthyonAbilityOptions, u as AuthyonClientOptions, v as AuthyonPermissionSource, w as AuthyonSessionController, C as ConfirmApprovalInput, x as CreateOrganizationInput, F as FetchHttpAdapter, y as HttpAdapterRequest, z as HttpLogEvent, B as HttpLogger, I as IntrospectResult, D as InviteMemberInput, L as LoggingHttpAdapter, E as LoginInput, G as LoginResult, O as Organization, J as OrganizationInvite, K as OrganizationInviteAccepted, M as OrganizationInviteInput, N as OrganizationInviteIssued, P as OrganizationInvitePreview, Q as OrganizationInviteStatus, R as OrganizationMember, S as Paged, U as PaginationOptions, V as PasswordResetCompleted, W as PasswordResetPreview, X as PasswordResetRequestOptions, Y as PermissionGroup, Z as RegisterInput, _ as Role, $ as SecurityMethods, a0 as Session, a1 as SessionControllerOptions, a2 as SessionInfo, a3 as SessionSnapshot, a4 as SessionSnapshotListener, a5 as SessionStatus, a6 as SsoProvider, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TwoFactorChallenge, aa as TwoFactorMethod, ab as TwoFactorStatus, ac as User, ad as ValidateResult, ae as VerifyTwoFactorInput, af as WebAuthnAssertion, ag as WebAuthnCeremonyStart, ah as WebAuthnCredential, ai as createAuthyonAbility, aj as createAuthyonRules, ak as createClient, al as hasPermission, am as hasPermissionGroup } from './ability-BTcayvkM.js';
3
3
 
4
4
  declare const ErrorCodes: {
5
5
  readonly Unknown: "unknown";
package/dist/index.js CHANGED
@@ -533,13 +533,36 @@ var AuthyonClient = class {
533
533
  method: "DELETE",
534
534
  bearer: true
535
535
  }),
536
- /** POST /auth/password-reset/request — always resolves (no account enumeration). */
537
- requestPasswordReset: (email) => this.request("/auth/password-reset/request", { method: "POST", body: { email } }),
538
- /** POST /auth/password-reset/confirm — sets a new password and revokes all refresh tokens. */
539
- confirmPasswordReset: (token, newPassword) => this.request("/auth/password-reset/confirm", {
536
+ /**
537
+ * POST /auth/password-reset/request — resolves whether or not the address
538
+ * has an account (no account enumeration). `redirectUri` is where the
539
+ * person lands after changing the password; it must be one of the
540
+ * environment's registered redirect URIs, or the call rejects with
541
+ * `user.password_reset.redirect_uri.not_allowed`.
542
+ */
543
+ requestPasswordReset: (email, options = {}) => this.request("/auth/password-reset/request", {
540
544
  method: "POST",
541
- body: { token, newPassword }
542
- })
545
+ body: { email, ...options }
546
+ }),
547
+ /**
548
+ * POST /auth/password-reset/validate — checks a reset token without
549
+ * spending it, so the reset page can refuse a dead link before asking for
550
+ * a password. Rejects with `user.password_reset.invalid` (401) when the
551
+ * token is unknown, used or expired.
552
+ */
553
+ validatePasswordReset: (token) => this.request("/auth/password-reset/validate", { method: "POST", body: { token } }),
554
+ /**
555
+ * POST /auth/password-reset/confirm — sets a new password and revokes all
556
+ * refresh tokens. Resolves with the `redirectUri` the reset was requested
557
+ * with (`null` when there was none); following it is up to the caller.
558
+ */
559
+ confirmPasswordReset: async (token, newPassword) => {
560
+ const done = await this.request(
561
+ "/auth/password-reset/confirm",
562
+ { method: "POST", body: { token, newPassword } }
563
+ );
564
+ return { redirectUri: done?.redirectUri ?? null };
565
+ }
543
566
  };
544
567
  // ── Organization ─────────────────────────────────────────────────────────
545
568
  this.organization = {
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { a9 as User, _ as SessionControllerOptions, A as AuthyonClient, a0 as SessionSnapshot, Z as Session, f as AbilitySubject, t as AuthyonAbilityOptions, r as AuthyonAbility } from '../ability-Cp8ir5Gr.cjs';
4
- export { w as AuthyonSessionController, a1 as SessionSnapshotListener, a2 as SessionStatus } from '../ability-Cp8ir5Gr.cjs';
3
+ import { ac as User, a1 as SessionControllerOptions, A as AuthyonClient, a3 as SessionSnapshot, a0 as Session, f as AbilitySubject, t as AuthyonAbilityOptions, r as AuthyonAbility } from '../ability-BTcayvkM.cjs';
4
+ export { w as AuthyonSessionController, a4 as SessionSnapshotListener, a5 as SessionStatus } from '../ability-BTcayvkM.cjs';
5
5
 
6
6
  interface AuthyonProviderProps<TUser extends User = User> extends SessionControllerOptions {
7
7
  client: AuthyonClient;
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { a9 as User, _ as SessionControllerOptions, A as AuthyonClient, a0 as SessionSnapshot, Z as Session, f as AbilitySubject, t as AuthyonAbilityOptions, r as AuthyonAbility } from '../ability-Cp8ir5Gr.js';
4
- export { w as AuthyonSessionController, a1 as SessionSnapshotListener, a2 as SessionStatus } from '../ability-Cp8ir5Gr.js';
3
+ import { ac as User, a1 as SessionControllerOptions, A as AuthyonClient, a3 as SessionSnapshot, a0 as Session, f as AbilitySubject, t as AuthyonAbilityOptions, r as AuthyonAbility } from '../ability-BTcayvkM.js';
4
+ export { w as AuthyonSessionController, a4 as SessionSnapshotListener, a5 as SessionStatus } from '../ability-BTcayvkM.js';
5
5
 
6
6
  interface AuthyonProviderProps<TUser extends User = User> extends SessionControllerOptions {
7
7
  client: AuthyonClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authyon/auth",
3
- "version": "0.2.0-beta.16",
3
+ "version": "0.2.0-beta.19",
4
4
  "description": "Authyon SDK for browsers — auth, sessions, multi-tenant and 2FA for vanilla JS/TS.",
5
5
  "license": "MIT",
6
6
  "type": "module",