Web: Added desktop parameter from url for oAuth login

This commit is contained in:
Ilya Oleshko 2021-10-14 15:24:13 +03:00
parent af31f2fb9b
commit 678fa4c119

View File

@ -52,10 +52,12 @@
const searchUrl = location.search.substring(1);
const object = JSON.parse(
'{"' +
decodeURIComponent(searchUrl
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')) +
decodeURIComponent(
searchUrl
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
) +
'"}'
);
@ -70,6 +72,7 @@
const urlParams = getObjectByLocation(window.location);
const code = urlParams ? urlParams.code || null : null;
const error = urlParams ? urlParams.error || null : null;
const desktop = urlParams ? urlParams.desktop || false : false;
</script>
</head>
<body id="third-party-body">
@ -78,6 +81,9 @@
<script>
if (code) {
localStorage.setItem("code", code);
if (desktop) {
window.location = `/login.ashx?code=${code}&desktop=true`;
}
} else if (error) {
renderError(error);
}