更换socket鉴权方式

This commit is contained in:
undefined committed 2020-07-31 17:47:42 +08:00
1 parent 8bb389eedd
commit b9076cd5d3
7 files changed
+61 -59

No files matched your search

+1 -4
View File
@@ -62,10 +62,7 @@ class DiscussionHandler extends Handler {
// TODO(twd2): exclude problem/contest discussions?
// TODO(iceboy): continuation based pagination.
if (ObjectID.isValid(name)) name = new ObjectID(name);
this.vnode = await discussion.getVnode(domainId, {
parentType: typeMapper[type],
parentId: name,
}, this);
this.vnode = await discussion.getVnode(domainId, typeMapper[type], name, this);
if (this.ddoc) {
this.ddoc.parentType = this.ddoc.parentType || this.vnode.type;
this.ddoc.parentId = this.ddoc.parentId || this.vnode.id;
-7
View File
@@ -102,12 +102,6 @@ class SwitchLanguageHandler extends Handler {
}
}
class SockToken extends Handler {
async get() {
this.response.body = { token: this.UIContext.token };
}
}
class UiSettingsHandler extends Handler {
async get() {
const [
@@ -143,7 +137,6 @@ export async function apply() {
Route('status', '/status', StatusHandler);
Route('status_update', '/status/update', StatusUpdateHandler);
Route('switch_language', '/language/:lang', SwitchLanguageHandler);
Route('token', '/token', SockToken);
Route('ui', '/extra.css', UiSettingsHandler);
}