forked from FoundKeyGang/FoundKey
Fix bug
This commit is contained in:
parent
f61348f697
commit
bf57b2ad13
1 changed files with 20 additions and 14 deletions
|
@ -118,21 +118,27 @@ if (config.twitter == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
redis.get(sessid, async (_, twCtx) => {
|
const get = new Promise<any>((res, rej) => {
|
||||||
const result = await twAuth.done(JSON.parse(twCtx), ctx.query.oauth_verifier);
|
redis.get(sessid, async (_, twCtx) => {
|
||||||
|
res(twCtx);
|
||||||
const user = await User.findOne({
|
});
|
||||||
host: null,
|
|
||||||
'twitter.userId': result.userId
|
|
||||||
}) as ILocalUser;
|
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
ctx.throw(404, `@${result.screenName}と連携しているMisskeyアカウントはありませんでした...`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
signin(ctx, user, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const twCtx = await get;
|
||||||
|
|
||||||
|
const result = await twAuth.done(JSON.parse(twCtx), ctx.query.oauth_verifier);
|
||||||
|
|
||||||
|
const user = await User.findOne({
|
||||||
|
host: null,
|
||||||
|
'twitter.userId': result.userId
|
||||||
|
}) as ILocalUser;
|
||||||
|
|
||||||
|
if (user == null) {
|
||||||
|
ctx.throw(404, `@${result.screenName}と連携しているMisskeyアカウントはありませんでした...`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
signin(ctx, user, true);
|
||||||
} else {
|
} else {
|
||||||
const verifier = ctx.query.oauth_verifier;
|
const verifier = ctx.query.oauth_verifier;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue