Overview
I had the opportunity to try local authentication with @sidebase/nuxt-auth, so this is a personal note for future reference.
Background
In the following article, I introduced how to perform Drupal authentication using @sidebase/nuxt-auth.
In that article, I was using Nuxt 3’s SSR with the authjs provider of @sidebase/nuxt-auth. The provider descriptions are as follows.
authjs: for non-static apps that want to use Auth.js / NextAuth.js to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX) local: for static pages that rely on an external backend with a credential flow for authentication. The Local Provider also supports refresh tokens since v0.9.0. Read more here.
When creating an application with SSG or similar, it seems necessary to use the latter method.
Source Code
The repository is at the following URL.
https://github.com/nakamura196/nuxt-auth-local-drupal
The source code is shown below.
When using local authentication, it appeared that installing next-auth is not necessary and only @sidebase/nuxt-auth is needed.
Drupal authentication is used. Set CMS_URL to a value like https://drupal.example.org.
Through trial and error, I was able to achieve minimal functionality by configuring signIn and getSession as follows.
Behavior
The following login form is displayed. Enter the username and password.

The status becomes loading.

As a result, the following is displayed. In this implementation, the session token set in data is displayed.

Summary
The getSession endpoint should probably be changed to something else, but I hope this serves as a useful reference for local authentication with @sidebase/nuxt-auth.