Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Login: FC<LoginProps> = ({ isLoggedIn }) => {
if (isLoggedIn === LoginStatus.LOGGED_IN) {
return navigate('/');
} else if (isLoggedIn === LoginStatus.NOT_LOGGED_IN) {
window.location.href = `https://login.elixir-czech.org/oidc/authorize?response_type=token id_token&scope=openid profile email eduperson_entitlement ga4gh_passport_v1&client_id=5fc66010-a596-48e4-8c09-89a767ef136c&state=StAtE&redirect_uri=${HOST_URI}`;
window.location.href = `https://login.aai.lifescience-ri.eu/oidc/authorize?response_type=token id_token&scope=openid profile email eduperson_entitlement ga4gh_passport_v1&client_id=5fc66010-a596-48e4-8c09-89a767ef136c&state=StAtE&redirect_uri=${HOST_URI}`;
}
}, [isLoggedIn, navigate]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Navbar: FC<NavbarProps> = ({
const handleLogout = async () => {
const params = JSON.parse(localStorage.getItem(AUTH_TOKEN) || '{}');
localStorage.removeItem(AUTH_TOKEN);
window.location.href = `https://login.elixir-czech.org/oidc/endsession?id_token_hint=${params.id_token}&post_logout_redirect_uri=${HOST_URI}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Handle missing or invalid id_token_hint

Check that params.id_token is defined before appending it; otherwise a missing or malformed AUTH_TOKEN yields an undefined id_token_hint and breaks the logout URL.

window.location.href = `https://login.aai.lifescience-ri.eu/oidc/endsession?id_token_hint=${params.id_token}&post_logout_redirect_uri=${HOST_URI}`;
setIsLoggedIn(LoginStatus.NOT_LOGGED_IN);
};

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Layout = () => {
setIsLoggedIn(LoginStatus.LOADING);
try {
const response = await axios.get(
'https://login.elixir-czech.org/oidc/userinfo',
'https://login.aai.lifescience-ri.eu/oidc/userinfo',
{
headers: {
Authorization: `Bearer ${localParams?.access_token || ''}`
Expand Down