feat: add MyAccount API client support#1121
Open
yogeshchoudhary147 wants to merge 1 commit into
Open
Conversation
d54a6c0 to
7df25d8
Compare
pmathew92
reviewed
Jun 16, 2026
7df25d8 to
6b746c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
myAccountclient introduced in auth0-spa-js#1615 was not yet surfaced through the React SDK. This PR exposes it so it is accessible viauseAuth0.Changes
useAuth0().myAccount(new)Factors
getFactors(): list all MFA factors enabled on the tenant with theirtypeandusageAuthentication methods
getAuthenticationMethods(type?): list enrolled methods, optionally filtered by typegetAuthenticationMethod(id): get a single method by IDupdateAuthenticationMethod(id, data): updatenameorpreferred_authentication_methoddeleteAuthenticationMethod(id): remove an enrolled methodEnrollment (two-step)
enrollmentChallenge(options): initiate enrollment for any factor type; returns challenge data (WebAuthn creation options, barcode URI, recovery code, password policy, etc.)enrollmentVerify(options): confirm enrollment; returns the createdAuthenticationMethodSupports:
passkey,webauthn-platform,webauthn-roaming,phone,email,totp,push-notification,recovery-code,password.Implementation pattern
myAccountfollows the same pattern asmfa— auseMemo(() => client.myAccount, [client])passthrough. NouseCallbackwrappers orGET_ACCESS_TOKEN_COMPLETEdispatches are needed since none of these operations affectisAuthenticatedoruser.Exports
MyAccountApiClient(type) andMyAccountApiErrorare now exported from the package root.Dependency
Bumps
@auth0/auth0-spa-jsto^2.21.1.Test plan
Manual: authentication methods CRUD
getAuthenticationMethods()/getAuthenticationMethods("passkey"): correct fields, filtering worksgetAuthenticationMethod(id): correct shapeupdateAuthenticationMethod(id, { name }): confirmed working fortotpdeleteAuthenticationMethod(id): secondary methods deleted; primary passkey deletion correctly rejectedgetFactors(): all enabled factors returned with correcttypeandusageManual: end-to-end passkey enrollment
enrollmentChallenge+enrollmentVerifyauth0.passkey.login()with no password requiredRegression
connectAccountWithRedirect+handleRedirectCallback: connected accounts flow unaffectedauth0.passkey.signup()/auth0.passkey.login(): passkey flows unaffected