Skip to content

Commit d05d830

Browse files
Add some notes
1 parent 3498717 commit d05d830

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,17 @@ npm start
3333
```
3434

3535
## Notes
36+
37+
### Authentication with JWT
38+
39+
Currently, both, the auth and refresh token, are stored in localStorage.
40+
This is not best practice but was a simple way to persist auth state across browser refresh.
41+
Research better alternatives here:
42+
43+
* https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/#jwt_persist
44+
* https://github.com/wp-graphql/wp-graphql-jwt-authentication
45+
46+
### Refreshing the JWT
47+
48+
Currently, the auth token will be refreshed when it is expired when a request has to be done.
49+
Maybe it would be better to silently refesh it in the background whenever it expires.

0 commit comments

Comments
 (0)