Skip to content

Commit

Permalink
O3-2409: Login: support interpolation in loginUrl and logoutUrl (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich authored Sep 14, 2023
1 parent 3f7080e commit b1d9e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/apps/esm-login-app/src/login/login.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
clearCurrentUser,
getSessionStore,
useConnectivity,
navigate as openmrsNavigate,
} from "@openmrs/esm-framework";
import { performLogin } from "../login.resource";
import styles from "./login.scss";
Expand Down Expand Up @@ -78,8 +79,7 @@ const Login: React.FC<LoginProps> = () => {

useEffect(() => {
if (!user && config.provider.type === "oauth2") {
const loginUrl = config.provider.loginUrl;
window.location.href = loginUrl;
openmrsNavigate({ to: config.provider.loginUrl });
}
}, [config, user]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const RedirectLogout: React.FC<RedirectLogoutProps> = () => {
} else {
performLogout().then(() => {
if (config.provider.type === "oauth2") {
location.href = config.provider.logoutUrl;
navigate({ to: config.provider.logoutUrl });
} else {
navigate({ to: "${openmrsSpaBase}/login" });
}
Expand Down

0 comments on commit b1d9e74

Please sign in to comment.