serhiisol / ngx-auth

Angular 16+ Authentication Module
MIT License
234 stars 47 forks source link

Does it handle token expiration? #14

Closed nimatrazmjo closed 6 years ago

nimatrazmjo commented 6 years ago

What if JWT token expired, what will happen?

serhiisol commented 6 years ago

Hi @nimatullah, basically library relies on correct backend response. For example, once token got expired backend throws you 401 status and some specific error code that you can handle in refreshShouldHappen method of AuthService, also in this method you can analyse that request and make a decision whether token should be refreshed or not.

nimatrazmjo commented 6 years ago

Ok, I will use the library, and if I stuck on something then I will ask :)

serhiisol commented 6 years ago

Ok :)

nimatrazmjo commented 6 years ago

@serhiisol, my angular version is 4.4.4, should I use ngx-auth@2.2.0 or the latest one?

serhiisol commented 6 years ago

check please README.md