33 BASE_URL ,
44 CAS_AUTH_REDIRECT ,
55 OAUTH_REDIRECT ,
6- USER_INFO_COMPLETION ,
76} from "constants/routesURL" ;
87import { AxiosPromise , AxiosResponse } from "axios" ;
98import { ApiResponse } from "api/apiResponses" ;
@@ -16,6 +15,7 @@ import { createContext, useState } from "react";
1615import { SystemConfig } from "constants/configConstants" ;
1716import {
1817 AuthInviteInfo ,
18+ AuthSearchParamsType ,
1919 AuthSessionStoreParams ,
2020 ThirdPartyAuthGoal ,
2121 ThirdPartyAuthType ,
@@ -79,12 +79,7 @@ export function authRespValidate(
7979) {
8080 let replaceUrl = redirectUrl || BASE_URL ;
8181 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+
8883 if ( doValidResponse ( resp ) ) {
8984 onAuthSuccess ?.( ) ;
9085 history . replace ( replaceUrl . replace ( baseUrl , '' ) ) ;
@@ -185,3 +180,21 @@ export const getRedirectUrl = (authType: ThirdPartyAuthType) => {
185180 `${ window . location . origin } ${ authType === "CAS" ? CAS_AUTH_REDIRECT : OAUTH_REDIRECT } `
186181 ) ;
187182} ;
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+ }
0 commit comments