core: fix domain bind url_prefix generation

This commit is contained in:
undefined committed 2021-07-24 14:57:27 +08:00
1 parent f6a7ae4620
commit 9a18d2f4c7
2 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.29.38",
"version": "2.29.39",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+6 -2
View File
@@ -85,7 +85,9 @@ export class UserRegisterHandler extends Handler {
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 instanceof Array ? this.domain.host[0] : this.domain.host) || system.get('server.url'),
url_prefix: this.domain.host
? `${this.domain.host instanceof Array ? this.domain.host[0] : this.domain.host}/`
: system.get('server.url'),
});
await sendMail(mail, 'Sign Up', 'user_register_mail', m);
this.response.template = 'user_register_mail_sent.html';
@@ -154,7 +156,9 @@ class UserLostPassHandler extends Handler {
);
const m = await this.renderHTML('user_lostpass_mail.html', {
url: `lostpass/${tid}`,
url_prefix: (this.domain.host instanceof Array ? this.domain.host[0] : this.domain.host) || system.get('server.url'),
url_prefix: this.domain.host
? `${this.domain.host instanceof Array ? this.domain.host[0] : this.domain.host}/`
: system.get('server.url'),
uname: udoc.uname,
});
await sendMail(mail, 'Lost Password', 'user_lostpass_mail', m);