Code Monkey home page Code Monkey logo

auth's Introduction

Hey hey people

AlexAegis's GitHub stats

auth's People

Contributors

alexaegis avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fossabot hope-ag

auth's Issues

Multiple requests at same time with expired token all trigger a refresh request [bug]

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.

[feature] construct a demo page

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

[feature] Error handling on token failures

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)

[bug] Angular 8 support

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<
                             ~~~~~~~~~~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.