https://github.com/sydrawat01/auth
Authentication with Firebase REST API and Redux Toolkit.
https://github.com/sydrawat01/auth
auth firebase redux redux-toolkit typescript
Last synced: 3 months ago
JSON representation
Authentication with Firebase REST API and Redux Toolkit.
- Host: GitHub
- URL: https://github.com/sydrawat01/auth
- Owner: sydrawat01
- Created: 2021-05-10T15:14:54.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T14:52:58.000Z (about 5 years ago)
- Last Synced: 2025-04-02T05:16:49.762Z (about 1 year ago)
- Topics: auth, firebase, redux, redux-toolkit, typescript
- Language: TypeScript
- Homepage:
- Size: 236 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Auth with Firebase
Basic auth with [Firebase Auth REST API](https://firebase.google.com/docs/reference/rest/auth).
Using [Redux Toolkit](https://redux-toolkit.js.org/) for global state management.
## `.env` file
React apps initialized using `create-react-app` have `.dotenv` pacgkage built in, and need to have the `REACT_APP` prefix to the environment variables. More about these [here](https://create-react-app.dev/docs/adding-custom-environment-variables/).
To access these .env variables, use `process.env.`.
Here's an example of what the `.env` file looks like:
```js
REACT_APP_API_KEY = 'YOUR_API_KEY';
REACT_APP_SIGN_UP =
'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${REACT_APP_API_KEY}';
REACT_APP_SIGN_IN =
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=${REACT_APP_API_KEY}';
REACT_APP_CHANGE_PWD =
'https://identitytoolkit.googleapis.com/v1/accounts:update?key=${REACT_APP_API_KEY}';
```
## TODO
- [x] Use the `Modal` to display error messages.
- [x] [Fix Memory Leak Bug](https://github.com/sydrawat/auth/issues/1).
- [ ] Add auto logout based on the expiration time [`expiresIn` property from the response payload].
- [x] Migrate app to use Redux Toolkit with TypeScript.