Fix external service authentication (#4846)
This commit is contained in:
@ -203,12 +203,8 @@ router.get('/dc/cb', async ctx => {
|
||||
}
|
||||
|
||||
const profile = await UserProfiles.createQueryBuilder()
|
||||
.where('discord @> :discord', {
|
||||
discord: {
|
||||
id: id,
|
||||
},
|
||||
})
|
||||
.andWhere('userHost IS NULL')
|
||||
.where('"discordId" = :id', { id: id })
|
||||
.andWhere('"userHost" IS NULL')
|
||||
.getOne();
|
||||
|
||||
if (profile == null) {
|
||||
|
@ -193,12 +193,8 @@ router.get('/gh/cb', async ctx => {
|
||||
}
|
||||
|
||||
const link = await UserProfiles.createQueryBuilder()
|
||||
.where('github @> :github', {
|
||||
github: {
|
||||
id: id,
|
||||
},
|
||||
})
|
||||
.andWhere('userHost IS NULL')
|
||||
.where('"githubId" = :id', { id: id })
|
||||
.andWhere('"userHost" IS NULL')
|
||||
.getOne();
|
||||
|
||||
if (link == null) {
|
||||
|
@ -141,12 +141,8 @@ router.get('/tw/cb', async ctx => {
|
||||
const result = await twAuth!.done(JSON.parse(twCtx), ctx.query.oauth_verifier);
|
||||
|
||||
const link = await UserProfiles.createQueryBuilder()
|
||||
.where('twitter @> :twitter', {
|
||||
twitter: {
|
||||
userId: result.userId,
|
||||
},
|
||||
})
|
||||
.andWhere('userHost IS NULL')
|
||||
.where('"twitterUserId" = :id', { id: result.userId })
|
||||
.andWhere('"userHost" IS NULL')
|
||||
.getOne();
|
||||
|
||||
if (link == null) {
|
||||
|
Reference in New Issue
Block a user