12 Commits

Author SHA1 Message Date
Lauren Zugai
f9528dbd99 fix(totp): Use otplib/preset-browser for consistent 2FA setup, handle server OTP reject
Because:
* There's an error case some users experience where it appears a client-side OTP code check is valid but our server then rejects it. We mishandle the error state and tell the user 2FA setup was successful

This commit:
* Updates our front-end OTP check in fxa-settings to use the same library our backend uses (otplib, but for the browser)
* Has auth-server throw an error if the TOTP code is invalid during set up, and handles it properly in the front-end by checking for an error, not updating apollo cache to show a successful TOTP setup if there is an error, and displays an error for the user

closes FXA-12035
2025-07-18 13:06:35 -05:00
Ben Bangert
8771178ee3 feat: vendor fxa-crypto-relier as crypto-relier
Because:

* We want to incorporate the fxa-crypto-relier library into the Firefox
  Accounts codebase and deprecated its webextension functionality.

This commit:

* Adds the fxa-crypto-relier library to the Firefox Accounts codebase.

Closes FXA-9741
2024-06-03 14:03:11 -07:00
Ben Bangert
9a649c6441 feat: vendor fxa-jwtool
Because:

* We want to reduce the dependencies in fxa-jwtool and bring more
  of the functionality into the monorepo.

This commit:

* Moves and updates the fxa-jwtool code to function the same
  except as TypeScript with classes and no additional dependencies.
2024-05-06 07:52:16 -07:00
Reino Muhl
652c09ab50 feat(next): add l10n to localizer for next rsc
Because:

* Ensure all localization strings can be localized in React Server
  Components.

This commit:

* Removes LocalizerServer
* Adds LocalizerRSC to serve as a wrapper for ReactLocalization that can
  be used by React Server Components, as well as a few other utility
  methods.
* Adds LocalizerRscFactory that instantiates LocalizerRSC only with
  bundles for a provided acceptLanguage string.
* Adds LocalizerRscFactoryProvider to be used with the NestApp to
  instantiate and then intialize the LocalizerRscFactory. Initalization
  will fetch all messages from disk and populate the bundles.
* Reorganize shared/l10n library to match Node style guide
* Removes demo l10n code
* Update purchase-details, terms-and-service components, and success and
  error pages to use new LocalizerRSC class for localization.
* Adds temporary l10n-convert script to provide translation for existing
  ftl strings.

Closes #FXA-8822
2024-04-08 14:58:17 -04:00
Julian Poyourow
565ebb89c9 chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00
Ben Bangert
ef2d33a38a refactor(auth): convert account to TS and class
Because:

* New routes and some account cleanup is needed for allowing a new
  account with no password. This requires multiple re-usable functions
  to be extracted from the existing create account handler.

This commit:

* Converts the account.js file to TypeScript and refactors the handlers
  into a class to make room for the new account creation route.

Ref #8735
2021-05-28 07:29:36 -07:00
Ben Bangert
553bb238df feat(event-broker): migrate to NestJS
Because:

* We are using NestJS for application architecture on new projects.

This commit:

* Moves the event-broker to a NestJS architecture.

Closes #6238
2020-08-31 12:59:54 -07:00
Danny Coates
7358a3cae5 feat(auth-client): replace fxa-js-client with fxa-auth-client
- We have two clients for the auth-server API, one in `content-server/app/scripts/lib/auth` and `fxa-js-client`. The content-server one was meant to replace fxa-js-client but I didn't finish the work to get it running on nodejs.

- Extracts the content-server implementation into `fxa-auth-client`
- Wraps the implementation with shims to work with nodejs in `server.ts`
- Updates references to fxa-js-client to use fxa-auth-client
- Removes fxa-js-client
2020-07-21 09:08:35 -07:00
Ben Bangert
17edcd473d feat(gql-api): Add totp/recovery code mutations.
Because:

* The gql-api needs the ability to issue new recovery codes and
  update the users two-factor auth settings.

This commit:

* Add's two-factor auth and recovery code mutations.

Closes #5395
2020-06-08 14:17:46 -07:00
Ben Bangert
adb832f79d feat(gql-api): add attached client revoke
Because:

* We want to allow gql-api clients to revoke attached clients.

This commit:

* Add's the attachedClientDisconnect mutation.

Closes #5398
2020-06-08 10:41:27 -07:00
Ben Bangert
28abf66a2f feat(graphql-api): add profile/email mutations
Because:

* We want to alter/update the profile avatar/displayname and modify
  email addresses in use.

This commit:

* Add's mutations to upload an avatar, change the display name, and
  manipulate email addresses in use.

Closes #5397, #5396
2020-05-28 10:17:15 -07:00
Danny Coates
e565285b7e refactor(tsconfig): consolidate common tsconfig options
To reduce duplication and encourage consistency in our
typescript builds this extracts most of the options
into two base configs, one for node and one for browsers.

Also, in order to better utilize workspaces the require
paths to fxa-shared and fxa-react were updated throughout.
2020-05-26 12:18:51 -07:00