mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
Fix bug
This commit is contained in:
parent
562c89cdde
commit
5f3421513b
@ -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 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 get = new Promise<any>((res, rej) => {
|
||||
redis.get(sessid, async (_, twCtx) => {
|
||||
res(twCtx);
|
||||
});
|
||||
});
|
||||
|
||||
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 {
|
||||
const verifier = ctx.query.oauth_verifier;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user