serhiisol/ngx-auth
소개
Angular 20+ Authentication Module
보안 및 개인정보 보호측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAngular 20+ Authentication
This package provides authentication module with interceptor
npm install ngx-auth --save
For older versions of angular see Older Versions section.
Full example
Full example you can find in the example folder.
Authentication module
Authentication modules provides ability to attach authentication token automatically to the headers (through http interceptors), refresh token functionality, guards for protected or public pages and more.
Usage
- Import
NgxAuthServiceinterface to implement it with your custom Authentication service, e.g.: - Specify functions
ngxPublicGuardfor public routes andngxProtectedGuardfor protected respectively, e.g.: - Use
provideNgxAuthProvidersto provideNgxAuthServiceimplementation andprotectedRedirectUri,publicRedirectUriredirect uris
Customizing authentication headers
By default, requests are intercepted and a { Authorization: 'Bearer ${token}'} header is injected. To customize this behavior, implement the getHeaders method on your NgxAuthService
After login redirect to the interrupted URL
The NgxAuthService has an optional method setInterruptedUrl which saves the URL that was requested before the user is redirected to the login page. This property can be used in order to redirect the user to the originally requested page after he logs in.
Older Versions
For angular 16-19, use version 6.0.0
npm install [email protected] --save
For angular 7-15, use version 5.4.0
npm install [email protected] --save
For angular 6, use version 4.1.0
npm install [email protected] --save
For angular 5, use version 3.1.0
npm install [email protected] --save
For angular 4, use version 2.2.0
npm install [email protected] --save
관련 프로젝트 살펴보기
불러오는 중…