I'm building a Nuxt app with Nuxt Auth, connecting to backend service using Django, DRF, dj-rest-auth & django-simplejwt. I'm able to successfully make my web app to do social login with Google. Users can login successfully to my Nuxt app (and authenticate in backend) using Google social login. However, my Nuxt app cannot refresh the token correctly.
For some context, django-simplejwt exposes 2 different endpoints for:
to obtain access token (/dj-rest-auth/login/ and /dj-rest-auth/facebook/ for social login)
My Nuxt app is able to obtain an access token from my Django app correctly. However, my Nuxt app cannot refresh the token because the nuxt auth refreshing token because it is using the same access_token endpoint.
When my access token is expiring, the Nuxt auth module will refresh the token at ${process.env.API_SERVER_URL}rest-auth/google/. What I need is that Nuxt auth to refresh token at ${process.env.API_SERVER_URL}rest-auth/token/refresh/
Allow the dev to set the refresh endpoint in the Oauth2 scheme in nuxt.config.js file. It would be great if it allows users to set more variables like in localRefresh scheme.
This feature request is available on Nuxt community (#c704)
What problem does this feature solve?
I'm building a Nuxt app with Nuxt Auth, connecting to backend service using Django, DRF, dj-rest-auth & django-simplejwt. I'm able to successfully make my web app to do social login with Google. Users can login successfully to my Nuxt app (and authenticate in backend) using Google social login. However, my Nuxt app cannot refresh the token correctly.
For some context, django-simplejwt exposes 2 different endpoints for:
/dj-rest-auth/login/
and/dj-rest-auth/facebook/
for social login)/dj-rest-auth/token/refresh/
).You may refer here for more information: https://dj-rest-auth.readthedocs.io/en/latest/api_endpoints.html
My Nuxt app is able to obtain an access token from my Django app correctly. However, my Nuxt app cannot refresh the token because the nuxt auth refreshing token because it is using the same
access_token
endpoint.Here's is the auth section of my nuxt.config file
When my access token is expiring, the Nuxt auth module will refresh the token at
${process.env.API_SERVER_URL}rest-auth/google/
. What I need is that Nuxt auth to refresh token at${process.env.API_SERVER_URL}rest-auth/token/refresh/
I'm using Nuxt Auth v5.0 dev
My Django and Nuxt app is inspired from this code https://github.com/Maronato/nuxt-django-auth
What does the proposed changes look like?
Allow the dev to set the
refresh
endpoint in the Oauth2 scheme in nuxt.config.js file. It would be great if it allows users to set more variables like in localRefresh scheme.