core: add fallback for unknown user

This commit is contained in:
undefined committed 2022-08-01 20:02:23 +08:00
1 parent 58ab74fcfc
commit a8675a45c5
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.15.1", "version": "3.15.2",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+1 -1
View File
@@ -86,7 +86,7 @@ export class User {
this.priv = udoc.priv; this.priv = udoc.priv;
this.regat = udoc.regat; this.regat = udoc.regat;
this.loginat = udoc.loginat; this.loginat = udoc.loginat;
this.perm = dudoc.perm; this.perm = dudoc.perm || 0n; // This is a fallback for unknown user
this.scope = typeof scope === 'string' ? BigInt(scope) : scope; this.scope = typeof scope === 'string' ? BigInt(scope) : scope;
this.role = dudoc.role || 'default'; this.role = dudoc.role || 'default';
this.tfa = !!udoc.tfa; this.tfa = !!udoc.tfa;