Commit d67ef74 1 parent c0f8210 commit d67ef74 Copy full SHA for d67ef74
File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Button , ButtonProps , Link } from '@mui/material' ;
3
- import { useConfig } from '../../../domain/platform/config/useConfig' ;
4
- import { ButtonTypeMap } from '@mui/material/Button/Button' ;
5
- import { buildReturnUrlParam } from '../../../main/routing/urlBuilders' ;
6
3
import { useLocation } from 'react-router-dom' ;
4
+ import { ButtonTypeMap } from '@mui/material/Button/Button' ;
5
+ import { buildLoginUrl } from '../../../main/routing/urlBuilders' ;
7
6
8
7
const IdentityRouteLink = < D extends React . ElementType = ButtonTypeMap [ 'defaultComponent' ] , P = { } > ( {
9
8
children,
10
9
to,
11
10
...props
12
11
} : ButtonProps < D , P > & { to : string } ) => {
13
- const config = useConfig ( ) ;
14
-
15
- const rootUrl = config . authentication ?. providers [ 0 ] . config . issuer ;
16
-
17
12
const { pathname } = useLocation ( ) ;
18
13
19
14
return (
20
- < Button component = { Link } href = { ` ${ rootUrl } ${ to } ${ buildReturnUrlParam ( pathname ) } ` } { ...props } >
15
+ < Button component = { Link } href = { buildLoginUrl ( pathname ) } { ...props } >
21
16
{ children }
22
17
</ Button >
23
18
) ;
You can’t perform that action at this time.
0 commit comments