Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

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.

Notifications You must be signed in to change notification settings

mahieyin-rahmun/NextJsWithDRFExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published