mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +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",
|
||||
"version": "2.29.5",
|
||||
"version": "2.29.6",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -80,7 +80,7 @@ export class UserRegisterHandler extends Handler {
|
||||
system.get('session.unsaved_expire_seconds'),
|
||||
{ mail },
|
||||
);
|
||||
if (system.get('smtp.verify')) {
|
||||
if (system.get('smtp.verify') && system.get('smtp.user')) {
|
||||
const m = await this.renderHTML('user_register_mail.html', {
|
||||
path: `register/${t[0]}`,
|
||||
url_prefix: (this.domain.host || [])[0] || system.get('server.url'),
|
||||
|
||||
@@ -116,7 +116,7 @@ class TaskModel {
|
||||
|
||||
static getFirst = getFirst;
|
||||
|
||||
static async getDelay(query?: FilterQuery<Task>) {
|
||||
static async getDelay(query?: FilterQuery<Task>): Promise<[number, Date]> {
|
||||
const now = new Date();
|
||||
const res = await coll.findOne(query, { sort: { executeAfter: 1 } });
|
||||
if (res) return [Math.max(0, now.getTime() - res.executeAfter.getTime()), res.executeAfter];
|
||||
|
||||
Reference in new issue
Block a user