Skip to content

Commit c3bafb4

Browse files
authored
feat: use quartz, not idpe, for user sessions (#5769)
* fix: use quartz for sessions behind feat flag * chore: fix relative import of feature flag * chore: remove unnecessary comment
1 parent abcd4f6 commit c3bafb4

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/Signin.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
import {RemoteDataState} from 'src/types'
3333

3434
// APIs
35-
import {fetchLegacyIdentity} from './identity/apis/auth'
35+
import {fetchIdentity, fetchLegacyIdentity} from './identity/apis/auth'
3636

3737
interface State {
3838
loading: RemoteDataState
@@ -96,7 +96,12 @@ export class Signin extends PureComponent<Props, State> {
9696

9797
private checkForLogin = async () => {
9898
try {
99-
await fetchLegacyIdentity()
99+
if (isFlagEnabled('quartzSession')) {
100+
await fetchIdentity()
101+
} else {
102+
await fetchLegacyIdentity()
103+
}
104+
100105
this.setState({auth: true})
101106
const redirectIsSet = !!getFromLocalStorage('redirectTo')
102107
if (redirectIsSet) {

src/identity/apis/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const fetchIdentity = async () => {
118118
if (!CLOUD) {
119119
return fetchLegacyIdentity()
120120
}
121-
// if we make it to this line we are in cloud and ui unification flag is on
121+
122122
if (isFlagEnabled('quartzIdentity')) {
123123
return fetchQuartzIdentity()
124124
}

src/onboarding/containers/LoginPage.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import Notifications from 'src/shared/components/notifications/Notifications'
1212
import {CloudLogoWithCubo} from 'src/onboarding/components/CloudLogoWithCubo'
1313

1414
// APIs
15-
import {fetchLegacyIdentity} from 'src/identity/apis/auth'
15+
import {fetchIdentity, fetchLegacyIdentity} from 'src/identity/apis/auth'
1616

1717
// Components
1818
import ErrorBoundary from 'src/shared/components/ErrorBoundary'
1919
import LoginPageContents from 'src/onboarding/containers/LoginPageContents'
2020
import {CLOUD, CLOUD_QUARTZ_URL} from 'src/shared/constants'
21-
import {isFlagEnabled} from '../../shared/utils/featureFlag'
21+
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
2222

2323
const EMPTY_HISTORY_STACK_LENGTH = 2
2424

@@ -27,7 +27,12 @@ export const LoginPage: FC = () => {
2727

2828
const getSessionValidity = useCallback(async () => {
2929
try {
30-
await fetchLegacyIdentity()
30+
if (isFlagEnabled('quartzSession')) {
31+
await fetchIdentity()
32+
} else {
33+
await fetchLegacyIdentity()
34+
}
35+
3136
setHasValidSession(true)
3237
} catch {
3338
setHasValidSession(false)

0 commit comments

Comments
 (0)