Skip to content

Add support for Nuxt 4 #1043

@mridang

Description

@mridang

Describe the feature

This feature request is to add full support and compatibility for Nuxt 4.

With the official release of Nuxt 4, developers are eager to migrate their projects to leverage its performance gains, improved developer experience, and new features. nuxt-auth is a critical part of the ecosystem for many Nuxt applications, and ensuring its compatibility will allow the community to build modern, secure applications without being locked into an older version of the framework.

Use Case: Any developer wanting to start a new project with Nuxt 4 or upgrade an existing Nuxt 3 project that uses nuxt-auth.

Alternatives Considered: The only alternatives are to either (1) postpone upgrading to Nuxt 4, missing out on its benefits, or (2) migrate away from nuxt-auth to a different authentication solution. Both are undesirable for developers who rely on this module.

How would you implement this?

Update Dependencies: The package.json would need to be updated to list Nuxt 4 packages in peerDependencies and update relevant development dependencies like @nuxt/kit and nuxt.

Adapt to Nuxt 4 Changes: The codebase would need to be audited and updated to ensure compatibility with key changes in Nuxt 4, including:

Project Structure: Verify that module injections and file generation work with Nuxt 4's app/ directory structure.

Data Fetching: Review usages of useAsyncData and useFetch within the module to align with Nuxt 4's updated data-fetching logic.

TypeScript: Test against Nuxt 4's improved TypeScript support to resolve any newly surfaced type errors or inconsistencies.

Server/Nitro: Ensure the server-side endpoints and middleware provided by nuxt-auth are fully compatible with the version of Nitro that ships with Nuxt 4.

Comprehensive Testing: Create a test project using Nuxt 4 and run a full suite of tests covering all authentication providers (AuthJS, local, refresh) to catch any regressions or breaking changes introduced by the new version.

Additional information

  • Would you be willing to help implement this feature?

Provider

  • AuthJS
  • Local
  • Refresh
  • New Provider

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeA change will changes that require at least a minor release.enhancementAn improvement that needs to be added

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions