Skip to content

Commit

Permalink
fixed white screen when trying to open the live demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ialakey committed Jun 17, 2024
1 parent 8b5acb1 commit f23cc91
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions web/src/containers/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,35 @@ interface SignInProps {
}

function SignIn(props: SignInProps) {
const clientId = localStorage.getItem('clientId') || 'sdc-ide';
authorize(clientId, { nextUrl: props.originPathName });
useEffect(() => {
const clientId = localStorage.getItem('clientId');
if (clientId != null) {
authorize(clientId, { nextUrl: props.originPathName });
}
}, [props.originPathName]);

return null;
const handleAuthorizeClick = () => {
authorize('sdc-ide', { nextUrl: props.originPathName });
};

return (
<div style={{ textAlign: 'center', marginTop: '50px' }}>
<h2>Welcome to SDC IDE!</h2>
<p>
To launch the IDE on top of EMR, please use the following default login credentials:
<br />
Username: admin / receptionist / practitioner1 / practitioner2 <br />
Password: password
</p>
<p>
Click{' '}
<a href="#" onClick={handleAuthorizeClick}>
here
</a>{' '}
to run IDE on top of EMR.
</p>
</div>
);
}

export function Auth() {
Expand Down

0 comments on commit f23cc91

Please sign in to comment.