redirect archived user to /account-archived page when login
This commit is contained in:
@ -35,7 +35,7 @@ import {
|
||||
} from '../../utils/auth'
|
||||
import { corsConfig } from '../../utils/corsConfig'
|
||||
import { logger } from '../../utils/logger'
|
||||
import { DEFAULT_HOME_PATH } from '../../utils/navigation'
|
||||
import { ARCHIVE_ACCOUNT_PATH, DEFAULT_HOME_PATH } from '../../utils/navigation'
|
||||
import { hourlyLimiter } from '../../utils/rate_limit'
|
||||
import { verifyChallengeRecaptcha } from '../../utils/recaptcha'
|
||||
import { createSsoToken, ssoRedirectURL } from '../../utils/sso'
|
||||
@ -379,7 +379,7 @@ export function authRouter() {
|
||||
}
|
||||
|
||||
if (user.status === StatusType.Archived) {
|
||||
redirectUri = `${env.client.url}/export`
|
||||
redirectUri = `${env.client.url}${ARCHIVE_ACCOUNT_PATH}`
|
||||
}
|
||||
|
||||
redirectUri = redirectUri ?? `${env.client.url}${DEFAULT_HOME_PATH}`
|
||||
|
||||
@ -6,7 +6,7 @@ import { env, homePageURL } from '../../env'
|
||||
import { LoginErrorCode } from '../../generated/graphql'
|
||||
import { userRepository } from '../../repository/user'
|
||||
import { logger } from '../../utils/logger'
|
||||
import { DEFAULT_HOME_PATH } from '../../utils/navigation'
|
||||
import { ARCHIVE_ACCOUNT_PATH, DEFAULT_HOME_PATH } from '../../utils/navigation'
|
||||
import { createSsoToken, ssoRedirectURL } from '../../utils/sso'
|
||||
import { DecodeTokenResult } from './auth_types'
|
||||
import { createPendingUserToken, createWebAuthToken } from './jwt_helpers'
|
||||
@ -158,7 +158,9 @@ export async function handleGoogleWebAuth(
|
||||
}
|
||||
|
||||
let redirectURL = `${baseURL()}${
|
||||
user.status === StatusType.Archived ? '/export' : DEFAULT_HOME_PATH
|
||||
user.status === StatusType.Archived
|
||||
? ARCHIVE_ACCOUNT_PATH
|
||||
: DEFAULT_HOME_PATH
|
||||
}`
|
||||
|
||||
const authToken = await createWebAuthToken(userId)
|
||||
|
||||
@ -3,7 +3,6 @@ import express, { Router } from 'express'
|
||||
import { TaskState } from '../generated/graphql'
|
||||
import { jobStateToTaskState } from '../queue-processor'
|
||||
import { countExportsWithin24Hours, saveExport } from '../services/export'
|
||||
import { sendExportJobEmail } from '../services/send_emails'
|
||||
import { getClaimsByToken, getTokenByRequest } from '../utils/auth'
|
||||
import { corsConfig } from '../utils/corsConfig'
|
||||
import { queueExportJob } from '../utils/createTask'
|
||||
|
||||
@ -1 +1,2 @@
|
||||
export const DEFAULT_HOME_PATH = '/home'
|
||||
export const ARCHIVE_ACCOUNT_PATH = '/account-archived'
|
||||
|
||||
Reference in New Issue
Block a user