mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
+login-with-qq
This commit is contained in:
1 parent
09ced5cdff
commit
ac9dc00c6a
12 files changed
+133
-3
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user