Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
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
8 changes: 5 additions & 3 deletions login-view/src/components/ErrorMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const useStyles = makeStyles(theme => ({
function ErrorMessage(props) {
const classes = useStyles();
return (
<div className={classes.error}>
{props.error}
</div>
<div className={classes.error} dangerouslySetInnerHTML={ createMarkup(props.error) } />
)
}

function createMarkup(error) {
return {__html: error};
}

export default ErrorMessage;
15 changes: 14 additions & 1 deletion login-view/src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,20 @@ function Login() {
})
.catch(error => {
console.log("error=", error);
setError(error.toString());
const data = {
email: username,
password: password
};
const cmd = {
host: 'lightapi.net',
service: 'user',
action: 'loginUser',
version: '0.1.0',
data: data
};
const url = '/portal/query?cmd=' + encodeURIComponent(JSON.stringify(cmd));
const message = 'Login Failed! Click <a href="link">here</a> to identify root cause.'
setError(message.replace('link', url));
});
};

Expand Down
1 change: 1 addition & 0 deletions login-view/src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) {
app.use('/oauth2/code', createProxyMiddleware({ target: 'https://localhost:6881', secure: false }));
app.use('/portal/command', createProxyMiddleware({ target: 'https://localhost:8441', secure: false }));
app.use('/portal/query', createProxyMiddleware({ target: 'https://localhost:8442', secure: false }));
};