pull/23/head
undefined 4 years ago
parent 0195137c61
commit 288279d965

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.13.55",
"version": "2.13.56",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",

@ -498,6 +498,7 @@ export class Handler {
this.session.scope = PERM.PERM_ALL.toString();
this.user = await user.getById(domainId, this.session.uid, this.session.scope);
}
if (this.user._id === 0 && this.session.viewLang) this.user.viewLang = this.session.viewLang;
this.csrfToken = this.getCsrfToken(this.session._id || String.random(32));
this.UIContext.csrfToken = this.csrfToken;
this.loginMethods = filter(Object.keys(global.Hydro.lib), (str) => str.startsWith('oauth_'))
@ -836,6 +837,7 @@ export class ConnectionHandler {
if (bdoc) throw new BlacklistedError(this.request.ip);
this.user = await user.getById(domainId, this.session.uid, this.session.scope);
if (!this.user) throw new UserNotFoundError(this.session.uid);
if (this.user._id === 0 && this.session.viewLang) this.user.viewLang = this.session.viewLang;
}
}

Loading…
Cancel
Save