auth0 / nextjs-auth0

Next.js SDK for signing in with Auth0
MIT License
2.07k stars 392 forks source link

v4.0.0-beta.7 - Cannot export withMiddlewareAuthRequired() #1812

Open SvitlanaNedilko opened 2 days ago

SvitlanaNedilko commented 2 days ago

Checklist

Description

I would like to be able to use withMiddlewareAuthRequired by import { useUser } from '@auth0/nextjs-auth0/edge' but Cannot find module @auth0/nextjs-auth0/edge or its corresponding type declarations.

In previous versions we were able to do

import { UserProfile, useUser } from '@auth0/nextjs-auth0/client'

Reproduction

import withMiddlewareAuthRequired

Additional context

No response

nextjs-auth0 version

4.0.0-beta.7

Next.js version

14.2.17

Node.js version

22.11.0

guabu commented 2 days ago

Hi @SvitlanaNedilko 👋 The v4 of the SDK exports the middleware under a different method and does not protect pages by default.

We have some docs on how to get a Next.js application set up using v4 of the SDK: https://github.com/auth0/nextjs-auth0/tree/v4?tab=readme-ov-file#getting-started

We plan to also add some migration docs to assist developers migrating from v3 to v4.