Skip to content

fix: allow passing MFA tickets when changing an account's email address - #179

Merged
Dadadah merged 2 commits into
stoatchat:mainfrom
gabgutf:main
Aug 3, 2026
Merged

fix: allow passing MFA tickets when changing an account's email address#179
Dadadah merged 2 commits into
stoatchat:mainfrom
gabgutf:main

Conversation

@gabgutf

@gabgutf gabgutf commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Adds an optional MFATicket parameter to AccountCollection.changeEmail().

Currently, accounts with MFA enabled fail when trying to change their email address because the backend endpoint mandates a verified ticket, but the SDK didn't expose any way to pass one (unlike Session.delete()).

Fixes #178

This commit adds an `MFATicket` parameter to the `AccountCollection.changeEmail`, which the backend mandates when the account has MFA enabled. The client still has to manually check whether passing a ticket is necessary by using `MFA.authenticatorEnabled`.

Signed-off-by: Gabriel Gutiérrez Fuentes <me@gab.gf>
Copilot AI review requested due to automatic review settings August 1, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates AccountCollection.changeEmail() to support MFA-enabled accounts by allowing callers to provide an MFA ticket that is sent to the backend via the X-MFA-Ticket header.

Changes:

  • Extend AccountCollection.changeEmail() to accept an optional MFATicket parameter.
  • Consume the MFA ticket before making the request and conditionally attach X-MFA-Ticket to the API call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/collections/AccountCollection.ts Outdated
Comment thread src/collections/AccountCollection.ts Outdated
Signed-off-by: Gabriel Gutiérrez Fuentes <me@gab.gf>
@Dadadah
Dadadah merged commit 33e526a into stoatchat:main Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AccountCollection.changeEmail() does not allow supplying an MFA ticket, preventing email changes on accounts with MFA enabled

3 participants