Skip to content
rw3iss Auth

AccountModule

AccountModule

Defined in: auth-client/src/core/modules/account.module.ts:13

Constructors

Constructor

new AccountModule(ctx): AccountModule

Defined in: auth-client/src/core/modules/account.module.ts:14

Parameters

ctx

ModuleContext

Returns

AccountModule

Methods

acceptInvitation()

acceptInvitation(invitationId): Promise<Organization | null>

Defined in: auth-client/src/core/modules/account.module.ts:98

POST /me/invitations/{id}/accept — join the org. After success call switchOrg(organizationId) to scope the active token.

Parameters

invitationId

string

Returns

Promise<Organization | null>


changePassword()

changePassword(currentPassword, newPassword): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:40

Change the password for the currently-signed-in user. Server verifies the current password before applying the change. Authenticated flow — caller must be signed in.

Parameters

currentPassword

string

newPassword

string

Returns

Promise<void>


declineInvitation()

declineInvitation(invitationId): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:104

POST /me/invitations/{id}/decline.

Parameters

invitationId

string

Returns

Promise<void>


deleteMyAccount()

deleteMyAccount(currentPassword): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:117

Delete the caller’s own account. Calls DELETE /me/account with the user’s current password + a typed “DELETE” confirmation (the server enforces both — we don’t try to be clever here). On success, the AuthClient’s snapshot transitions to anonymous (the access token’s tv claim is bumped server-side, refresh row was cascade-deleted with the user row).

Parameters

currentPassword

string

Returns

Promise<void>


disableTwoFactor()

disableTwoFactor(params): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:71

Turn 2FA off — requires the current password + a fresh code.

Parameters

params
code

string

password

string

Returns

Promise<void>


enableTwoFactor()

enableTwoFactor(code): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:65

Submit the first TOTP code to complete enrollment.

Parameters

code

string

Returns

Promise<void>


getMyOrgs()

getMyOrgs(): Promise<MyOrgRecord[]>

Defined in: auth-client/src/core/modules/account.module.ts:84

GET /me/orgs — the authenticated user’s organization memberships. Self-service mirror of getMyApps() / /me/apps. Lets UIs render an org-switcher without admin scope (AUTH-PHP-LARAVEL-DESIGN §5).

Returns the raw organizations array; consumers map it to their own UI shape. The response shape matches the admin variant so a shared renderer can take either source.

Returns

Promise<MyOrgRecord[]>


listMyInvitations()

listMyInvitations(): Promise<InvitationRecord[]>

Defined in: auth-client/src/core/modules/account.module.ts:89

GET /me/invitations — invitations addressed to me.

Returns

Promise<InvitationRecord[]>


requestPasswordReset()

requestPasswordReset(email, appCode?): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:20

Request a password-reset email. Server returns 200 regardless of whether the email exists (anti-enumeration). Anonymous flow.

Parameters

email

string

appCode?

string

Returns

Promise<void>


resendVerificationEmail()

resendVerificationEmail(email, appCode?): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:52

Re-issue a verification email. Always succeeds (anti-enumeration).

Parameters

email

string

appCode?

string

Returns

Promise<void>


resetPassword()

resetPassword(token, newPassword): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:30

Reset a password using a single-use token from the reset email. After success, the user must log in normally with the new password. Anonymous flow — no existing session required.

Parameters

token

string

newPassword

string

Returns

Promise<void>


setupTwoFactor()

setupTwoFactor(): Promise<{ provisioningUri: string; secret: string; }>

Defined in: auth-client/src/core/modules/account.module.ts:59

Begin TOTP enrollment. Returns the provisioning URI + base32 secret for the consumer to render as a QR code.

Returns

Promise<{ provisioningUri: string; secret: string; }>


verifyEmail()

verifyEmail(token): Promise<void>

Defined in: auth-client/src/core/modules/account.module.ts:46

Consume a single-use email-verification token from the verify email.

Parameters

token

string

Returns

Promise<void>