Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d-koppenhagen/ng-auth-ngrx
This repository works as a blueprint for Angular apps using Redux (ngrx) and authentication against a REST backend.
https://github.com/d-koppenhagen/ng-auth-ngrx
angular angular-cli authentication ngrx ngx
Last synced: 3 days ago
JSON representation
This repository works as a blueprint for Angular apps using Redux (ngrx) and authentication against a REST backend.
- Host: GitHub
- URL: https://github.com/d-koppenhagen/ng-auth-ngrx
- Owner: d-koppenhagen
- Created: 2018-07-09T14:45:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T17:38:51.000Z (about 6 years ago)
- Last Synced: 2024-10-11T06:11:50.380Z (about 1 month ago)
- Topics: angular, angular-cli, authentication, ngrx, ngx
- Language: TypeScript
- Homepage:
- Size: 2.55 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Authentication in Angular with NGRX
## Want to use this project?
1. Fork/Clone/Download
1. Install dependencies - `npm install`
1. Check the value for `apiUrl` in `src/environments/environment.prod.ts` and `src/environments/environment.ts` (depending on prod / dev environment and probably adjust it
1. Run the development server - `npm start`You will need to also spin up a back-end with the following routes:
| URL | HTTP Verb | Action | Request Data | Response Data |
|--------------------------------|-----------|---------------------|-------------------------------------------|-----------------------|
| http://localhost:8080/register | POST | Register a new user | | |
| http://localhost:8080/login | POST | Log a user in | { email: _string_, password: _string_ }| { expires: _number_, token: _string_, user: { email: _string_ }} |
| http://localhost:8080/api/v1/example | GET | Get some example data | | some JSON object |The returned token expiration will be checked against the current date. If the token is already expired, the backend should return an error.
## Backend
For trying out you can use the [This example backend](https://github.com/d-koppenhagen/auth-backend-example).