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

Repository Archived

The solution proposed here is currently outdated as of March 15, 2022. Next-Auth.js has had several revisions by now, including a new v4.0 release with a lot of changes to the API and new features. Please follow the updated documentation.

Next.js + NextAuth + Django Rest Framework Social Authentication Example

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.

The articles:

Part 1.

  • The basics
  • Getting access token

Part 2

  • Using the refresh token to refresh access tokens
  • Pitfalls of useSession() hook and its workaround (as of Apr 30, 2021)
  • Custom HOC to reduce code repetition.

The branches of this repository are named, accordingly, part-1 and part-2. The main branch contains all the changes of both parts merged together into a single, working application.

About

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.

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


Languages

Language:TypeScript 50.0%Language:Python 49.8%Language:Shell 0.2%