3
3
BASE_URL ,
4
4
CAS_AUTH_REDIRECT ,
5
5
OAUTH_REDIRECT ,
6
- USER_INFO_COMPLETION ,
7
6
} from "constants/routesURL" ;
8
7
import { AxiosPromise , AxiosResponse } from "axios" ;
9
8
import { ApiResponse } from "api/apiResponses" ;
@@ -16,6 +15,7 @@ import { createContext, useState } from "react";
16
15
import { SystemConfig } from "constants/configConstants" ;
17
16
import {
18
17
AuthInviteInfo ,
18
+ AuthSearchParamsType ,
19
19
AuthSessionStoreParams ,
20
20
ThirdPartyAuthGoal ,
21
21
ThirdPartyAuthType ,
@@ -79,12 +79,7 @@ export function authRespValidate(
79
79
) {
80
80
let replaceUrl = redirectUrl || BASE_URL ;
81
81
const baseUrl = `${ window . location . protocol } //${ window . location . host } ` ;
82
- if ( infoCompleteCheck ) {
83
- // need complete info
84
- replaceUrl = redirectUrl
85
- ?`${ USER_INFO_COMPLETION } ?redirectUrl=${ redirectUrl } `
86
- :USER_INFO_COMPLETION ;
87
- }
82
+
88
83
if ( doValidResponse ( resp ) ) {
89
84
onAuthSuccess ?.( ) ;
90
85
history . replace ( replaceUrl . replace ( baseUrl , '' ) ) ;
@@ -185,3 +180,21 @@ export const getRedirectUrl = (authType: ThirdPartyAuthType) => {
185
180
`${ window . location . origin } ${ authType === "CAS" ?CAS_AUTH_REDIRECT :OAUTH_REDIRECT } `
186
181
) ;
187
182
} ;
183
+
184
+ const AuthSearchParamStorageKey = "_temp_auth_search_params_" ;
185
+
186
+ export const saveAuthSearchParams = (
187
+ authSearchParams :AuthSearchParamsType
188
+ ) => {
189
+ sessionStorage . setItem ( AuthSearchParamStorageKey , JSON . stringify ( authSearchParams ) ) ;
190
+ }
191
+
192
+ export const loadAuthSearchParams = ( ) :AuthSearchParamsType | null => {
193
+ const authParams = sessionStorage . getItem ( AuthSearchParamStorageKey ) ;
194
+ if ( ! authParams ) return null ;
195
+ return JSON . parse ( authParams ) ;
196
+ }
197
+
198
+ export const clearAuthSearchParams = ( ) => {
199
+ sessionStorage . removeItem ( AuthSearchParamStorageKey ) ;
200
+ }