mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-18 06:00:18 +08:00
fixes #6279 - store the last use "remember login" state in localstorage - initialize firebase auth with correct persistence (LOCAL if "remember me" is set, SESSION otherwise) initialization of `Auth` needs to by awaited. This required some refactoring. During debugging it was useful to have easier control over the `Auth` object. Summary of the refactoring: - don't expose firebase `App` or `Auth` (except for email-handler) - initialise firebase in async method that can be awaited to ensure setup is done before any call to firebase - move `authStateChanged` handling from account-controller to our firebase module which then calls `account-controller.readyFunction`. - update all direct calls to `Auth` to use functions of our firebase module - move error handling and interpretation of `FirebaseError` to our module and removed duplicate code - use tryCatch helper on refactored code instead of native `try... catch` --------- Co-authored-by: Miodec <jack@monkeytype.com> Co-authored-by: Lukas <dev@mardybum.de> Co-authored-by: Seif Soliman <byseif21@gmail.com> |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| docker | ||
| scripts | ||
| src | ||
| static | ||
| .eslintrc.cjs | ||
| .firebaserc_example | ||
| .oxlintrc.json | ||
| firebase.json | ||
| gulpfile.js | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.dev.js | ||
| vite.config.js | ||
| vite.config.prod.js | ||
| vitest.config.ts | ||