Overview

This is a memo about important considerations when using sidebase/nuxt-auth in a production environment.

sidebase/nuxt-auth is an authentication module for Nuxt 3 applications.

https://github.com/sidebase/nuxt-auth

Problem

When deploying to Vercel or AWS Amplify, a server error occurred with the following message.

AUTH_NO_ORIGIN: No `origin` - this is an error in production, see https://sidebase.io/nuxt-auth/resources/errors. You can ignore this during development

Solution

The following was helpful.

https://github.com/sidebase/nuxt-auth/issues/613

By providing baseURL as shown below, the above error was resolved.

auth: {
      baseURL: process.env.AUTH_ORIGIN,
  },

Upon reviewing again, I found that this was documented at the following link, but it was not easy to find.

https://sidebase.io/nuxt-auth/configuration/nuxt-config#provider-authjs-baseurl

Summary

I hope this is helpful for those experiencing the same issue.