+login-with-qq

This commit is contained in:
undefined committed 2020-08-12 00:31:59 +08:00
1 parent 09ced5cdff
commit ac9dc00c6a
12 files changed
+133 -3

No files matched your search

+1 -1
View File
@@ -225,7 +225,7 @@ class OauthHandler extends Handler {
class OauthCallbackHandler extends Handler {
async get(args: any) {
let r;
if (global.Hydro.lib[`oauth_${args.type}`]) r = await global.Hydro.lib[`oauth_${args.type}`].callback(args);
if (global.Hydro.lib[`oauth_${args.type}`]) r = await global.Hydro.lib[`oauth_${args.type}`].callback.call(this, args);
else throw new UserFacingError('Oauth type');
const udoc = await user.getByEmail('system', r.email);
if (udoc) {
+1
View File
@@ -9,6 +9,7 @@ import cluster from 'cluster';
import fs from 'fs-extra';
import { argv } from 'yargs';
import AdmZip from 'adm-zip';
import { } from './utils';
export * from './interface';
+3 -1
View File
@@ -2,7 +2,7 @@ import { Collection } from 'mongodb';
import { TokenDoc } from '../interface';
import * as db from '../service/db';
const coll: Collection<TokenDoc> = db.collection('token');
export const coll: Collection<TokenDoc> = db.collection('token');
export const TYPE_SESSION = 0;
export const TYPE_REGISTRATION = 2;
@@ -88,6 +88,8 @@ export function delByUid(uid: number) {
global.Hydro.postInit.push(ensureIndexes);
global.Hydro.model.token = {
coll,
TYPE_SESSION,
TYPE_CHANGEMAIL,
TYPE_OAUTH,