disallow social login if account is deleted

This commit is contained in:
Hongbo Wu
2023-10-17 17:07:46 +08:00
parent 6e79f6c67f
commit 700fd73dbb
2 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import {
suggestedUsername,
} from './jwt_helpers'
import { analytics } from '../../utils/analytics'
import { StatusType } from '../../entity/user'
const appleBaseURL = 'https://appleid.apple.com'
const audienceName = 'app.omnivore.app'
@ -122,6 +123,7 @@ export async function handleAppleWebAuth(
const user = await userRepository.findOneBy({
sourceUserId: decodedTokenResult.sourceUserId,
source: 'APPLE',
status: StatusType.Active,
})
const userId = user?.id

View File

@ -1,6 +1,7 @@
import { google, oauth2_v2 as oauthV2 } from 'googleapis'
import { OAuth2Client } from 'googleapis-common'
import url from 'url'
import { StatusType } from '../../entity/user'
import { env, homePageURL } from '../../env'
import { LoginErrorCode } from '../../generated/graphql'
import { userRepository } from '../../repository/user'
@ -130,6 +131,7 @@ export async function handleGoogleWebAuth(
const user = await userRepository.findOneBy({
email,
source: 'GOOGLE',
status: StatusType.Active,
})
const userId = user?.id