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
Hi, I am using drf-simplejwt with Angular 9 for a project IntelOwl-ng.
How it works
I wrote a custom Auth.service.ts to work with simplejwt's access-refresh token pair which automatically sends refresh token request in background if access token expired but refresh token is still valid. So overall smooth and secure experience for the user.
Other interesting files which leverages the use of this auth service include,
auth-guard.service.ts,
user.service.ts,
login.component.ts, and most importantly,
http.intereceptor.ts - the main problem that this interceptor class solves is that we need to filter out the /api/refresh-token and /api/login endpoints
Thought this might be useful for anyone who stumbles on this project.
The text was updated successfully, but these errors were encountered:
eshaan7
changed the title
[Exammple] Custom Auth service that works with drf-simplejwt
[Example] Custom Auth Service that works with drf-simplejwt
Jul 15, 2020
Hi @eshaan7 Thanks for the provided code. The problem with that implementation (using SimpleJWT 4.4.0) is that many developers probably won't set up HTTPS protocol, so we're mitigating a lot of it for a new PR designed, reflecting a lot of what CSRF does, specifically for JS frameworks. The current PR in this repository uses that aforementioned PR for SimpleJWT which is more safe.
Hi, I am using drf-simplejwt with Angular 9 for a project IntelOwl-ng.
How it works
I wrote a custom
Auth.service.ts
to work with simplejwt's access-refresh token pair which automatically sends refresh token request in background if access token expired but refresh token is still valid. So overall smooth and secure experience for the user.isAuthenticatedOrRefresh()
is implemented in the HTTP interceptor as well as Auth Guard.Code
Auth.service.ts
: https://github.com/intelowlproject/IntelOwl-ng/blob/master/src/app/%40core/services/auth.service.tsOther interesting files which leverages the use of this auth service include,
auth-guard.service.ts
,user.service.ts
,login.component.ts
, and most importantly,http.intereceptor.ts
- the main problem that this interceptor class solves is that we need to filter out the/api/refresh-token
and/api/login
endpointsThought this might be useful for anyone who stumbles on this project.
The text was updated successfully, but these errors were encountered: