mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-06 16:07:14 +08:00
feat: worker: newAddress if domain is not set, use the first domain (#358)
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
- pages github actions && 修复清理邮件天数为 0 不生效 by @tqjason (#355)
|
- pages github actions && 修复清理邮件天数为 0 不生效 by @tqjason (#355)
|
||||||
- fix: imap proxy server 不支持 密码 by @dreamhunter2333 (#356)
|
- fix: imap proxy server 不支持 密码 by @dreamhunter2333 (#356)
|
||||||
- worker 新增 `ANNOUNCEMENT` 配置, 用于配置公告信息 by @dreamhunter2333 (#357)
|
- worker 新增 `ANNOUNCEMENT` 配置, 用于配置公告信息 by @dreamhunter2333 (#357)
|
||||||
|
- fix: telegram bot 新建地址默认选择第一个域名 by @dreamhunter2333 (#358)
|
||||||
|
|
||||||
## v0.6.0
|
## v0.6.0
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ export const newAddress = async (
|
|||||||
}
|
}
|
||||||
// check domain
|
// check domain
|
||||||
const allowDomains = checkAllowDomains ? await getAllowDomains(c) : getDomains(c);
|
const allowDomains = checkAllowDomains ? await getAllowDomains(c) : getDomains(c);
|
||||||
|
// if domain is not set, use the first domain
|
||||||
|
if (!domain && allowDomains.length > 0) {
|
||||||
|
domain = allowDomains[0];
|
||||||
|
}
|
||||||
|
// check domain is valid
|
||||||
if (!domain || !allowDomains.includes(domain)) {
|
if (!domain || !allowDomains.includes(domain)) {
|
||||||
throw new Error("Invalid domain")
|
throw new Error("Invalid domain")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user