概要
sidebase/nuxt-authをproduction環境で使う際の注意点に関する備忘録です。
sidebase/nuxt-authは、Nuxt 3 アプリケーション向けの認証モジュールです。
GitHub - sidebase/nuxt-auth: Authentication built for Nuxt! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
Authentication built for Nuxt! Easily add authentication via OAuth providers, credentials or Email Magic URLs! - sidebase/nuxt-auth
問題
VercelやAWS Amplifyにデプロイした際、以下のメッセージとともに、サーバエラーが発生しました。
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
対策
以下が参考になりました。
Error 500 on Vercel deployment · Issue #613 · sidebase/nuxt-auth
Environment No response Reproduction https://github.com/Timothy16/Rtechbizusers2.0 Demo is here: https://app-user-rtech.vercel.app/login Steps to reproduce Register and check the profile page Descr...
以下のようにbaseURLを与えることで、上記のエラーを解消できました。
auth: {
baseURL: process.env.AUTH_ORIGIN,
},
改めて確認すると、以下に記載がありましたが、なかなかたどり着くことができませんでした。

sidebase - by SIDESTREAM
The web app development kit to build production fullstack Nuxt 3+ apps quickly.
まとめ
同様の事象でお困りの方の参考になりましたら幸いです。
動画版(生成AIによる自動生成): この記事の内容をずんだもん×四国めたんの掛け合いで解説しています。自動生成のため、内容に誤りがある可能性があります。正確な情報は記事本文をご参照ください。




コメント
…