File tree Expand file tree Collapse file tree 4 files changed +12
-17
lines changed Expand file tree Collapse file tree 4 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 5252 "cy" : " CYPRESS_dexUrl=https://$INGRESS_HOST:$PORT_HTTPS CYPRESS_baseUrl=http://localhost:9999 cypress open" ,
5353 "cy:dev" : " source ../monitor-ci/.env && CYPRESS_dexUrl=CLOUD CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{cloud,shared}/**/*.*'" ,
5454 "cy:dev-oss" : " source ../monitor-ci/.env && CYPRESS_dexUrl=OSS CYPRESS_baseUrl=https://$INGRESS_HOST:$PORT_HTTPS cypress open --config testFiles='{oss,shared}/**/*.*'" ,
55- "generate" : " export SHA=ec907d13bbe519a5d370088dd76473db804c2483 && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta" ,
55+ "generate" : " export SHA=3ef04defe045c8333f458f0cc2959057183d217f && export REMOTE=https://raw.githubusercontent.com/influxdata/openapi/${SHA}/ && yarn generate-meta" ,
5656 "generate-local" : " export REMOTE=../openapi/ && yarn generate-meta" ,
5757 "generate-meta" : " if [ -z \" ${CLOUD_URL}\" ]; then yarn generate-meta-oss; else yarn generate-meta-cloud; fi" ,
5858 "generate-meta-oss" : " yarn oss-api && yarn notebooks && yarn unity && yarn annotations-oss && yarn pinned && yarn mapsd-oss && yarn uiproxyd-oss && yarn cloudPriv && yarn fluxdocs && yarn subscriptions-oss" ,
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ import {
3131
3232// Types
3333import { RemoteDataState } from 'src/types'
34- import { getMe } from 'src/client'
34+
35+ // APIs
36+ import { fetchIdentity } from './identity/apis/auth'
3537
3638interface State {
3739 loading : RemoteDataState
@@ -95,12 +97,7 @@ export class Signin extends PureComponent<Props, State> {
9597
9698 private checkForLogin = async ( ) => {
9799 try {
98- const resp = await getMe ( { } )
99-
100- if ( resp . status !== 200 ) {
101- throw new Error ( resp . data . message )
102- }
103-
100+ await fetchIdentity ( )
104101 this . setState ( { auth : true } )
105102 const redirectIsSet = ! ! getFromLocalStorage ( 'redirectTo' )
106103 if ( redirectIsSet ) {
Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ export const fetchIdentity = async () => {
8989 return fetchLegacyIdentity ( )
9090 }
9191 // if we make it to this line we are in cloud and ui unification flag is on
92-
9392 if ( isFlagEnabled ( 'quartzIdentity' ) ) {
9493 return fetchQuartzIdentity ( )
9594 }
@@ -137,6 +136,10 @@ export const fetchQuartzMe = async (): Promise<MeQuartz> => {
137136const fetchLegacyIdentity = async ( ) : Promise < UserResponseIdpe > => {
138137 const response = await getMeIdpe ( { } )
139138
139+ if ( response . status === 401 ) {
140+ throw new UnauthorizedError ( response . data . message )
141+ }
142+
140143 if ( response . status === 500 ) {
141144 const error : IdpeError = response . data
142145 throw new ServerError ( error . message )
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import {useHistory} from 'react-router-dom'
1111import Notifications from 'src/shared/components/notifications/Notifications'
1212import { CloudLogoWithCubo } from 'src/onboarding/components/CloudLogoWithCubo'
1313
14- // Types
15- import { getMe } from 'src/client '
14+ // APIs
15+ import { fetchIdentity } from 'src/identity/apis/auth '
1616
1717// Components
1818import ErrorBoundary from 'src/shared/components/ErrorBoundary'
@@ -25,12 +25,7 @@ export const LoginPage: FC = () => {
2525
2626 const getSessionValidity = useCallback ( async ( ) => {
2727 try {
28- const resp = await getMe ( { } )
29-
30- if ( resp . status !== 200 ) {
31- throw new Error ( resp . data . message )
32- }
33-
28+ await fetchIdentity ( )
3429 setHasValidSession ( true )
3530 } catch {
3631 setHasValidSession ( false )
You can’t perform that action at this time.
0 commit comments