mahieyin-rahmun / NextJsWithDRFExample

This repository contains the code for a two-part article series that deals with connecting a Django Rest Framework backend with a Next.js + Next-Auth client with Social Authentication. In this example, we use OAuth with Google, but this can be extended to any arbitrary number of Providers.

Home Page:https://mahieyin-rahmun.medium.com/how-to-configure-social-authentication-in-a-next-js-next-auth-django-rest-framework-application-cb4c82be137

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling of refresh token on DRF

umerjaved178 opened this issue · comments

Hey Mahieyin,

Thanks for your efforts to the community!

I am wondering why are you handling refreshing of access token on DRF while we can easily do this with next-auth in [...nextauth].js file.
https://next-auth.js.org/tutorials/refresh-token-rotation

Current:
You are making a call to DRF to get a refresh token

Expected:
We are already receiving refresh token on the first request, why you are not utilizing it instead you are making it from DRF at line 76

const { access_token, refresh_token } = response.data;

Looking forward to your reply 😊