NextJS with Auth0: API call resolved successfully but response not sent

I recently used the Auth0 article to implement user login in my NextJS application. The steps I followed are outlined below:

  1. First, I installed @auth0/nextjs-auth0
  2. Then, I wrapped my root component in _app.tsx with a <UserProvider> component.
  3. Next, I created an auth folder within pages/api and added a file named [...auth0].js that exports handleAuth from @auth0/nextjs-auth0.
  4. Additionally, I made sure to create a .env file with the necessary configuration settings.

Despite following all the instructions meticulously, when I attempt to log in by clicking on the link:

<a href="/api/auth/login">Login</a>
, nothing happens - just endless loading. Furthermore, the server message displayed states:
API resolved without sending a response for /api/auth/login, this could lead to stalled requests
. I have double-checked everything multiple times but remain unable to identify the issue. Any assistance or insights would be greatly appreciated.

Answer №1

Unfortunately, Auth0 is not yet compatible with the app directory feature of Next.js.

Click here for more information on Auth0 with Next.js

The new app directory introduced in Next.js 13 is still in beta testing phase, and Vercel advises against using it in a production environment. Therefore, the current SDK does not support this feature at this time.

Answer №2

Auth0 has announced that they are no longer supporting new app directory registrations. Instead, you can consider using NextAuth as an alternative solution.

If you're looking to integrate Django with a Next.js application, there is a helpful tutorial available. This tutorial covers the process of incorporating NextAuth for authentication in your Next.js 13 application.

Check out this link for more information

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Deleting a key from one object will also remove that key from another object - JavaScript

I have come across an interesting issue with my Javascript code. I am working with two objects, dict1 and dict2, where I need to maintain a form of state and then post the final object. When I click on certain buttons, I assign dict1 to dict2. However, wh ...

Utilize AJAX to dynamically insert data into the database

I have created a JSP page that displays records, and now I am looking to include a dynamic link or button in the JSP that allows inserting data into the database without needing to refresh the page. This link should open a pop-up window with input fields ...

remaining aligned after sending the form

Can someone help me figure out why my code is not submitting data to the database without redirecting the page? $('#saving').on('click', function() { var fname = $('#fname').val(); var lname = $('#lname ...

Discover the frequency of dynamically generated data stored in the Mongo Collection

When users add links to the Mongo Collection, I aim to retrieve the most popular ones based on the frequency of a particular link in the collection. For predefined data like the number of links from YouTube, you can use the following: Meteor.users.find({ ...

Tips for preserving dynamically generated HTML through Javascript during page reload

I have a straightforward question, but I haven't been able to find a suitable answer. Here's my situation: On my HTML page, I have a form. Using jQuery and AJAX, I submit the form and then use some JavaScript code to change the content of a spec ...

Ways to update CSS following button submission?

I'm facing an issue with two input fields in my ejs file that accept hexcodes. After entering the hexcodes and clicking the submit button, I update variables in my stylesheet to these hexcodes to change the background gradient. Is there a way to refre ...

Redirecting after executing JavaScript code

Is it possible to implement a redirect after the subscription script for push notifications has been executed successfully? <script> var OneSignal = window.OneSignal || []; OneSignal.push(function() { OneSignal.init({ ...

c# simulating button click through injected JavaScript

Greetings, I'm seeking assistance in replicating a specific button click on a website. Here is the code for the button: <button type="button" class="btn btn-link btn-xs" onclick="getComponents('188855', '5a0f44a9d70380.12406536&apo ...

What is the best approach to retain a user's selection for dark mode?

I have created a small website to showcase my work, but I'm struggling to figure out how to make the website remember a user's choice of dark mode. After searching on Stack Overflow, I came across suggestions like using cookies or localStorage. ...

Using the JavaScript validator library for data validation

Looking to utilize the validator in my express project. Is there a way to import only specific packages directly? For example: import {isEmail, isEmpty} from 'validator'; Alternatively, importing each on a separate line. Curious if there is a ...

Interactive JavaScript function designed to react to user commands

Struggling to develop a JavaScript/AngularJS function that notifies the user whether a entered number is too high or low (> 100 indicates it's too high)? Check out the HTML code below: <div> <p id="num">Number : <input type="nu ...

The code is throwing a SyntaxError because it encountered an unexpected character in the JSON file at position 650xx

I am encountering an issue when attempting to save a JSON-formatted file from within the Javascript app I am developing. The app is running on Node v6.11.0 with Express on my local machine, port 3000. Occasionally, I come across the following error: Synta ...

Is there a way to create an interactive animation where an image responds to the movement of the mouse, but does not directly follow it

Looking to create an interactive experience where images on the webpage move in response to mouse movement. For example, if an image is at coordinates (0,0) and the mouse moves from (32,45) to (32,47), the image should shift vertically by 2 pixels. I atte ...

Limiting the display to only a portion of the document in Monaco Editor

Is there a way to display only a specific portion of a document, or in the case of Monaco, a model, while still maintaining intellisense for the entire document? I am looking to enable users to edit only certain sections of a document, yet still have acce ...

Creating a dynamic start page for Progressive Web Apps (PWA) involves determining the

Recently, I developed a project called "Progressive Web App" using JavaScript and Visual Studio 2017. One key element of the project is the file "package.appxmanifest", which defines the StartPage. I am curious to know if there is a way to dynamically se ...

What is the best way to establish my permit requirements on a monthly basis?

An employee is only allowed to request up to 3 permits per month. If they need a fourth permit, they will have to wait until the following month. Here is my table structure for permissions: Permissions id (integer), format (text), date_r ...

Conflicts between Bootstrap Validator and Ajax.BeginForm in Partial Views of MVC

My current issue involves using Ajax.BeginForm to post data on a form without refreshing the entire page. The goal is to validate a textbox - if it has a value, then the data should be posted; otherwise, a validation message should be displayed. However, I ...

Query MongoDB using ISODate parameter sent from the Angular front end application

Looking for a way to make my mongoDB model query Model.find(query) more flexible. Instead of hardcoding a specific query, I want to be able to pass in dynamic objects to locate specific instances of the model. For example, I need to find instances before a ...

Moving Rows Between AgGrids

Experimenting with the example provided in this link (Dragging Multiple Records Between Grids) within my React application: https://www.ag-grid.com/react-data-grid/row-dragging-to-grid/ I have some inquiries; How can I retrieve the selected rows for the ...

Utilizing Mantine dropzone in conjunction with React Hook Form within a Javascript environment

Can Mantine dropzone be used with React hook form in JavaScript? I am currently working on a modal Upload using Tailwind components like this import { useForm } from 'react-hook-form'; import { Group, Text, useMantineTheme } from '@mantine/c ...