- Notifications
You must be signed in to change notification settings - Fork3
Open
Description
Description
Since the authentication logic is contained withing theAuthProvider
, accessing access token requires theuseContext
hook. React forbids using hook outside of a function component. That said, we cannot get the token in our services (rtk queries). The workaround currently is to pass the token to the query/mutation function as a parameter which is not ideal due to duplicated code. Instead of using native react context, we can store authentication info in a redux slice and consume the state by callinggetState
when defining any query/mutation.
Metadata
Metadata
Assignees
Type
Projects
Status
📋 Product Backlog