Skip to content
Snippets Groups Projects
Commit bf57b2ad authored by syuilo's avatar syuilo
Browse files

Fix bug

parent f61348f6
No related branches found
No related tags found
No related merge requests found
......@@ -118,21 +118,27 @@ if (config.twitter == null) {
return;
}
redis.get(sessid, async (_, twCtx) => {
const result = await twAuth.done(JSON.parse(twCtx), ctx.query.oauth_verifier);
const get = new Promise<any>((res, rej) => {
redis.get(sessid, async (_, twCtx) => {
res(twCtx);
});
});
const user = await User.findOne({
host: null,
'twitter.userId': result.userId
}) as ILocalUser;
const twCtx = await get;
if (user == null) {
ctx.throw(404, `@${result.screenName}と連携しているMisskeyアカウントはありませんでした...`);
return;
}
const result = await twAuth.done(JSON.parse(twCtx), ctx.query.oauth_verifier);
signin(ctx, user, true);
});
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 {
const verifier = ctx.query.oauth_verifier;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment