DocSpace-client/public/thirdparty/third-party.html

94 lines
2.4 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2021-09-24 18:18:50 +00:00
<link rel="shortcut icon" href="/favicon.ico" />
<title>Third party</title>
<style type="text/css">
2021-04-22 11:45:33 +00:00
#third-party-body {
cursor: default;
height: 100%;
width: 100%;
2021-04-22 11:45:33 +00:00
min-height: 100%;
overflow-x: hidden;
display: flex;
flex-direction: column;
align-items: center;
margin: 0;
padding: 36px 36px 0 36px;
border: 0;
box-sizing: border-box;
font-family: "Open Sans", sans-serif;
}
2021-04-22 11:45:33 +00:00
#container {
position: relative;
margin: 12px 0 60px 0;
}
2021-04-22 11:45:33 +00:00
.text {
font-size: 18px;
line-height: 22px;
text-align: center;
margin: auto;
max-width: 560px;
padding: 0;
}
2021-04-22 11:45:33 +00:00
img {
display: block;
width: 100%;
}
</style>
<script>
function getObjectByLocation(location) {
if (!location.search || !location.search.length) return null;
const searchUrl = location.search.substring(1);
const object = JSON.parse(
'{"' +
decodeURIComponent(
searchUrl
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
) +
'"}'
);
return object;
}
2021-04-22 11:45:33 +00:00
function renderError(error) {
var container = document.getElementById("container");
container.innerHTML = `<img src="/static/images/clouds.png" /><p class="text">${error}</p>`;
}
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;
2021-10-15 08:34:34 +00:00
const p = urlParams ? urlParams.p || false : false;
</script>
</head>
2021-04-22 11:45:33 +00:00
<body id="third-party-body">
<div id="container"></div>
</body>
<script>
if (code) {
localStorage.setItem("code", code);
if (desktop && p) {
window.location.href = `/login.ashx?p=${p}&code=${code}&desktop=true`;
}
2021-04-22 11:45:33 +00:00
} else if (error) {
renderError(error);
}
</script>
</html>