mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: auto-join system domain
This commit is contained in:
1 parent
e15a310351
commit
b9dbdc39ca
3 files changed
+20
-2
No files matched your search
@@ -276,6 +276,7 @@ DomainUserSetting(
|
||||
Setting('setting_storage', 'rpdelta', 0, 'number', 'RP.delta', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
Setting('setting_storage', 'rank', 0, 'number', 'Rank', null, FLAG_DISABLED | FLAG_HIDDEN),
|
||||
Setting('setting_storage', 'level', 0, 'number', 'level', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
Setting('setting_storage', 'join', 0, 'number', 'join', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
);
|
||||
|
||||
const ignoreUA = [
|
||||
|
||||
@@ -336,6 +336,12 @@ class UserModel {
|
||||
priv,
|
||||
avatar: `gravatar:${mail}`,
|
||||
});
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await domain.collUser.updateOne(
|
||||
{ uid, domainId: 'system' },
|
||||
{ $set: { join: true } },
|
||||
{ upsert: true },
|
||||
);
|
||||
return uid;
|
||||
} catch (e) {
|
||||
if (e?.code === 11000) {
|
||||
|
||||
Reference in new issue
Block a user