mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: also disable smtp if smtp.user doesn't exist
This commit is contained in:
1 parent
bc4d424abf
commit
cd4ada0845
3 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.29.5",
|
"version": "2.29.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class UserRegisterHandler extends Handler {
|
|||||||
system.get('session.unsaved_expire_seconds'),
|
system.get('session.unsaved_expire_seconds'),
|
||||||
{ mail },
|
{ mail },
|
||||||
);
|
);
|
||||||
if (system.get('smtp.verify')) {
|
if (system.get('smtp.verify') && system.get('smtp.user')) {
|
||||||
const m = await this.renderHTML('user_register_mail.html', {
|
const m = await this.renderHTML('user_register_mail.html', {
|
||||||
path: `register/${t[0]}`,
|
path: `register/${t[0]}`,
|
||||||
url_prefix: (this.domain.host || [])[0] || system.get('server.url'),
|
url_prefix: (this.domain.host || [])[0] || system.get('server.url'),
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class TaskModel {
|
|||||||
|
|
||||||
static getFirst = getFirst;
|
static getFirst = getFirst;
|
||||||
|
|
||||||
static async getDelay(query?: FilterQuery<Task>) {
|
static async getDelay(query?: FilterQuery<Task>): Promise<[number, Date]> {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const res = await coll.findOne(query, { sort: { executeAfter: 1 } });
|
const res = await coll.findOne(query, { sort: { executeAfter: 1 } });
|
||||||
if (res) return [Math.max(0, now.getTime() - res.executeAfter.getTime()), res.executeAfter];
|
if (res) return [Math.max(0, now.getTime() - res.executeAfter.getTime()), res.executeAfter];
|
||||||
|
|||||||
Reference in new issue
Block a user