From 54e1cdd3ff38e956c2c3a19e9dd39e1cb81c130a Mon Sep 17 00:00:00 2001 From: Harry Yep Date: Fri, 4 Aug 2023 21:54:11 +0800 Subject: [PATCH] fix: default `EMAIL_USE_SSL` --- README.JA.md | 1 + README.md | 3 ++- README.zh_CN.md | 1 + README.zh_HK.md | 1 + lib/auth.ts | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.JA.md b/README.JA.md index c2fd2497..38efa57c 100644 --- a/README.JA.md +++ b/README.JA.md @@ -72,6 +72,7 @@ https://github.com/users/okisdev/projects/7 をご参照ください | `NEXTAUTH_SECRET` | NextAuth Secret | | **Yes** | ランダムハッシュ(16 ビットが最適) | | `EMAIL_HOST` | SMTP ホスト | | No | | | `EMAIL_PORT` | SMTP ポート | | No | | +| `EMAIL_USE_SSL` | SMTP SSL | true | No | | | `EMAIL_USERNAME` | SMTP ユーザ名 | | No | | | `EMAIL_PASSWORD` | SMTP パスワード | | No | | | `EMAIL_FROM` | SMTP 送信アドレス | | No | | diff --git a/README.md b/README.md index 426f2ae6..8eb6488c 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,14 @@ Please refer to https://github.com/users/okisdev/projects/7 ### Environment variables -| variable name | description | default | mandatory | prompt | +| variable name | description | default | mandatory | tips | | ----------------- | --------------------------- | ------- | --------- | ----------------------------------------------------------------------------------------------------------------- | | `DATABASE_URL` | Postgresql database address | | **Yes** | Start with `postgresql://` (if not required, please fill in `postgresql://user:password@example.com:port/dbname`) | | `NEXTAUTH_URL` | Your website URL | | **Yes** | (with prefix) | | `NEXTAUTH_SECRET` | NextAuth Secret | | **Yes** | Random hash (16 bits is best) | | `EMAIL_HOST` | SMTP Host | | No | | | `EMAIL_PORT` | SMTP Port | | No | | +| `EMAIL_USE_SSL` | SMTP SSL | true | No | | | `EMAIL_USERNAME` | SMTP username | | No | | | `EMAIL_PASSWORD` | SMTP password | | No | | | `EMAIL_FROM` | SMTP sending address | | No | | diff --git a/README.zh_CN.md b/README.zh_CN.md index ad26587b..85e1a25c 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -73,6 +73,7 @@ https://user-images.githubusercontent.com/66008528/235539163-35f7ee91-e357-453a- | `NEXTAUTH_SECRET` | NextAuth Secret | | **Yes** | 随机哈希数值(16 位最佳) | | `EMAIL_HOST` | SMTP Host | | No | | | `EMAIL_PORT` | SMTP Port | | No | | +| `EMAIL_USE_SSL` | SMTP SSL | true | No | | | `EMAIL_USERNAME` | SMTP username | | No | | | `EMAIL_PASSWORD` | SMTP password | | No | | | `EMAIL_FROM` | SMTP 发送地址 | | No | | diff --git a/README.zh_HK.md b/README.zh_HK.md index 9a9839be..b1138cdd 100644 --- a/README.zh_HK.md +++ b/README.zh_HK.md @@ -72,6 +72,7 @@ https://user-images.githubusercontent.com/66008528/235539163-35f7ee91-e357-453a- | `NEXTAUTH_SECRET` | NextAuth Secret | | **Yes** | 隨機哈希數值(16 位最佳) | | `EMAIL_HOST` | SMTP Host | | No | | | `EMAIL_PORT` | SMTP Port | | No | | +| `EMAIL_USE_SSL` | SMTP SSL | true | No | | | `EMAIL_USERNAME` | SMTP username | | No | | | `EMAIL_PASSWORD` | SMTP password | | No | | | `EMAIL_FROM` | SMTP 發送地址 | | No | | diff --git a/lib/auth.ts b/lib/auth.ts index 0d9fda46..0a6a25d1 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -101,7 +101,7 @@ export const authOptions: NextAuthOptions = { server: { host: process.env.EMAIL_HOST, port: Number(process.env.EMAIL_PORT) || 587, - secure: process.env.EMAIL_USE_SSL, + secure: process.env.EMAIL_USE_SSL ?? true, auth: { user: process.env.EMAIL_USERNAME, pass: process.env.EMAIL_PASSWORD,