Skip to content

Commit d67ef74

Browse files
hero101ccanosvalentinyanakiev
authored
proper link to login page (#5455)
Co-authored-by: Carlos Cano <[email protected]> Co-authored-by: Valentin Yanakiev <[email protected]>
1 parent c0f8210 commit d67ef74

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/core/auth/components/IdentityRouteLink.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import React from 'react';
22
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';
63
import { useLocation } from 'react-router-dom';
4+
import { ButtonTypeMap } from '@mui/material/Button/Button';
5+
import { buildLoginUrl } from '../../../main/routing/urlBuilders';
76

87
const IdentityRouteLink = <D extends React.ElementType = ButtonTypeMap['defaultComponent'], P = {}>({
98
children,
109
to,
1110
...props
1211
}: ButtonProps<D, P> & { to: string }) => {
13-
const config = useConfig();
14-
15-
const rootUrl = config.authentication?.providers[0].config.issuer;
16-
1712
const { pathname } = useLocation();
1813

1914
return (
20-
<Button component={Link} href={`${rootUrl}${to}${buildReturnUrlParam(pathname)}`} {...props}>
15+
<Button component={Link} href={buildLoginUrl(pathname)} {...props}>
2116
{children}
2217
</Button>
2318
);

0 commit comments

Comments
 (0)