File tree Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {
18
18
} from 'react-router' ;
19
19
import { useDispatch , useSelector } from 'react-redux' ;
20
20
import { AppState } from '../redux/reducer' ;
21
- import { AppsMetadataSrv , UserAdminSrv } from '../services' ;
21
+ import { AppsMetadataSrv } from '../services' ;
22
22
import type { App } from '../components/App' ;
23
23
import { updateUserManagerDestructured } from '../redux/actions' ;
24
24
import { getErrorMessage } from '../utils/error' ;
@@ -78,7 +78,6 @@ const AppAuthStateWithRouterLayer: FunctionComponent<PropsWithChildren<{ layout:
78
78
dispatch ,
79
79
initialMatchSilentRenewCallbackUrl != null ,
80
80
AppsMetadataSrv . fetchIdpSettings ,
81
- UserAdminSrv . fetchValidateUser ,
82
81
initialMatchSignInCallbackUrl != null
83
82
) ) ?? null ,
84
83
null
Original file line number Diff line number Diff line change 5
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
*/
7
7
8
- import { User } from 'oidc-client' ;
9
8
import { backendFetch , backendFetchJson , getRestBase } from '../utils/api-rest' ;
10
- import { extractUserSub , getToken } from '../utils/api' ;
11
9
import { UUID } from 'crypto' ;
12
10
13
11
const USER_ADMIN_URL = `${ getRestBase ( ) } /user-admin/v1` ;
14
12
15
- /*
16
- * fetchValidateUser is call from commons-ui AuthServices to validate user infos before setting state.user!
17
- */
18
- export function fetchValidateUser ( user : User ) : Promise < boolean > {
19
- return extractUserSub ( user )
20
- . then ( ( sub ) => {
21
- console . debug ( `Fetching access for user "${ sub } "...` ) ;
22
- return backendFetch ( `${ USER_ADMIN_URL } /users/${ sub } ` , { method : 'head' } , getToken ( user ) ?? undefined ) ;
23
- } )
24
- . then ( ( response : Response ) => {
25
- //if the response is ok, the responseCode will be either 200 or 204 otherwise it's an HTTP error and it will be caught
26
- return response . status === 200 ;
27
- } )
28
- . catch ( ( error ) => {
29
- if ( error . status === 403 ) {
30
- return false ;
31
- } else {
32
- throw error ;
33
- }
34
- } ) ;
35
- }
36
-
37
13
export type UserInfos = {
38
14
sub : string ;
39
15
profileName ?: string ;
You can’t perform that action at this time.
0 commit comments