yarn add safe-compare static-auth -D
#or
npm i static-auth safe-compare -D
- Varcelへデプロイするアプリのルート直下にauth.js,vercel.jsonを設置する
- package.jsonのscriptを調整
"scripts": {
"dev": "next dev",
- "build": "next build",
+ "build": "next build && next export",
"start": "next start",
+ "vercel-build":"yarn build"
},
-
https://vercel.com/[username]/[app_name]/settings/environment-variables 内で Add New で下記環境変数を設定する
- USERNAME
- PASSWORD
-
Vercelへデプロイ🚀