Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change authentication process #136

Open
jbperidypathtech opened this issue Nov 9, 2023 · 0 comments
Open

Change authentication process #136

jbperidypathtech opened this issue Nov 9, 2023 · 0 comments

Comments

@jbperidypathtech
Copy link
Collaborator

Token is verified by axios.interceptor.request in /services/api/client.ts file. This is not the aim of an interceptor and force us to use some tricks to manage authentication with redirections.
In our case it seems the role of the interceptor should only to add bearer token in the authorization header.

Token verification shoud be done by the AuthContext.Provider. Several solutions:

  • write custom fetcher in useSWR => useSWR(APIRoutes.me, customFetcher)
  • write middleware in useSWR => useSWR(APIRoutes.me, axios, { use: [middleware]} )
  • use the NextAuth lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant