alexaegis / auth Goto Github PK
View Code? Open in Web Editor NEWAngular JWT Authentication Tools
Home Page: https://alexaegis.github.io/auth/
License: MIT License
Angular JWT Authentication Tools
Home Page: https://alexaegis.github.io/auth/
License: MIT License
The user already decides on how to store them so its up to to them, explore if this can be done automatically, reducing configuration
Extract and expose the core autorefresh mechanic
Dependabot was set up to create pull requests against the branch staging
, but couldn't find it.
If the branch has been permanently deleted you can update Dependabot's target branch from your dashboard.
Aside from the default, publish here too https://npm.pkg.github.com/
Describe the bug
Multiple requests fired off at the same time with an expired token all trigger a refresh request with the current refresh token.
The first refresh request succeeds which invalidates the refresh token as they are one time use, then all the other refresh requests fail because the refresh token has already been used.
To Reproduce
Have app that makes more than 1 request to JWT protected api at launch with a JWT token and refresh token already stored in app from a previous session.
Server rejects all those requests because of invalid JWT token.
Library then initiates a refresh request for every failed request.
1st refresh request succeeds, all subsequent requests in that batch fail due to refresh token already being used.
Expected behavior
All requests are queued and only a single refresh attempt is made.
From the demo page, the demo apps and the typedoc should be available
It should be deployed as a github page, served from the gh-branch
Automate it from an action
Or just configure github pages if allowed
A login based guard that lets you into routes when the user is logged in
It was migrated to the github integrated one
Introduce variadic generics on provider dependencies
Tracking issue: microsoft/TypeScript#38510
When logging in after the access token expires and the refresh failed for some reason (expired) call a callback and/or optionally use the router to navigate to a route
The config option on the refresh config could look like this:
onFailedRefresh: () => router.navigate( ... )
or
onFailedRefresh: 'path/to/login'
Signature
onFailedRefresh: string | () => void
TBD: Another callback on expired access tokens (Same logic, could be useful when no refresh config found. If the pipeline can do it on ultimate fail then do that and move the config option elsewhere. But that might cause confusion if name like this. In that case it should be called onTokenFailure
or something)
ERROR in ../node_modules/@aegis-auth/jwt/lib/component/base-directive.class.d.ts:20:19 - error TS1086: An accessor cannot be declared in an ambient context.
20 protected set teardown(subscription: Subscription);
~~~~~~~~
../node_modules/@aegis-auth/jwt/lib/model/typed-providers.interface.d.ts:21:26 - error TS2430: Interface 'TypedValueSansProvider<T>' incorrectly extends interface 'ValueSansProvider'.
Property 'useValue' is optional in type 'TypedValueSansProvider<T>' but required in type 'ValueSansProvider'.
21 export declare interface TypedValueSansProvider<T> extends ValueSansProvider {
~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@aegis-auth/jwt/lib/model/typed-providers.interface.d.ts:30:26 - error TS2430: Interface 'TypedClassSansProvider<T>' incorrectly extends interface 'ClassSansProvider'.
Property 'useClass' is optional in type 'TypedClassSansProvider<T>' but required in type 'ClassSansProvider'.
30 export declare interface TypedClassSansProvider<T> extends ClassSansProvider {
~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@aegis-auth/jwt/lib/model/typed-providers.interface.d.ts:46:26 - error TS2430: Interface 'TypedExistingSansProvider<T>' incorrectly extends interface 'ExistingSansProvider'.
Property 'useExisting' is optional in type 'TypedExistingSansProvider<T>' but required in type 'ExistingSansProvider'.
46 export declare interface TypedExistingSansProvider<T> extends ExistingSansProvider {
~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@aegis-auth/jwt/lib/model/typed-providers.interface.d.ts:110:26 - error TS2430: Interface 'TypedFactorySansProvider<T, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, U, V, W, X, Y, Z>' incorrectly extends interface 'FactorySansProvider'.
Property 'useFactory' is optional in type 'TypedFactorySansProvider<T, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, U, V, W, X, Y, Z>' but required in type 'FactorySansProvider'.
110 export declare interface TypedFactorySansProvider<
~~~~~~~~~~~~~~~~~~~~~~~~
Implement it using timer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.