You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
question about the decisions made in the repository
Issue description
Current behavior:
I'm using existing NbPasswordAuthStrategy and after the user becomes authenticated, the auth token successfully stores in localStorage and persists there until explicitly loggin out. Even if I restart by backend (which is implemented in Spring with Spring security), the user is still authenticated on a frontend but gets 401 doing request to a backend.
Expected behavior:
I was expecting that user authority will be checked on each page reload or in some other way (making a call to some /users/me endpoint). Please, suggest me what is the proper way to achieve this. UPD I can see someone implements this via http interceptors but maybe such behaviour could be added to a framework 'out-of-the-box'.
Steps to reproduce:
Authenticate user
Restart backend
User token still exists in local storage
Related code:
I decided to try to implement custom NbTokenStorage and override desired methods (one of or all of set, get, clear) and sticked into a get method, where I can check if the user is still authenticated on a backend, but this requires to make an http call while method should return a token itself instead of Observable and it seems that I've stand on a wrong path.
Other information:
npm, node, OS, Browser
node v16.3.0
npm 7.15.1
OS Linux (KDE Neon)
Browser: Chrome
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
I'm using existing
NbPasswordAuthStrategy
and after the user becomes authenticated, the auth token successfully stores inlocalStorage
and persists there until explicitly loggin out. Even if I restart by backend (which is implemented in Spring with Spring security), the user is still authenticated on a frontend but gets 401 doing request to a backend.Expected behavior:
I was expecting that user authority will be checked on each page reload or in some other way (making a call to some
/users/me
endpoint). Please, suggest me what is the proper way to achieve this.UPD I can see someone implements this via http interceptors but maybe such behaviour could be added to a framework 'out-of-the-box'.
Steps to reproduce:
Related code:
I decided to try to implement custom
NbTokenStorage
and override desired methods (one of or all ofset
,get
,clear
) and sticked into aget
method, where I can check if the user is still authenticated on a backend, but this requires to make an http call while method should return a token itself instead ofObservable
and it seems that I've stand on a wrong path.Other information:
npm, node, OS, Browser
Angular, Nebular
The text was updated successfully, but these errors were encountered: