mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'device-mgt-redirection-fix' into 'master'
Fix login redirection in devicemgt react app Closes product-iots#297 See merge request entgra/carbon-device-mgt!411
This commit is contained in:
commit
e1f7c3b073
@ -101,7 +101,12 @@ class NormalLoginForm extends React.Component {
|
||||
axios.post(window.location.origin+ config.serverConfig.loginUri, request
|
||||
).then(res => {
|
||||
if (res.status === 200) {
|
||||
window.location = window.location.origin+ "/entgra";
|
||||
let redirectUrl = window.location.origin + "/entgra";
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
if (searchParams.has("redirect")) {
|
||||
redirectUrl = searchParams.get("redirect");
|
||||
}
|
||||
window.location = redirectUrl;
|
||||
}
|
||||
}).catch(function (error) {
|
||||
if (error.response.status === 400) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user