Files
onlyoffice.github.io/sdkjs-plugins/content/mendeley/oauth.html
Alexander Trofimov 48b05f172c Add mendeley plugin
2022-06-25 10:08:42 +03:00

43 lines
1.4 KiB
HTML

<!--
(c) Copyright Ascensio System SIA 2020
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mendeley</title>
</head>
<body spellcheck="false" class="noselect">
<script>
(function () {
function parseLocation() {
try {
var matches = document.location.hash.match(new RegExp("access_token=([^&]*)&state=([^&]*)"));
if (matches && matches[1] && matches[2]) {
window.opener.OAuthCallback(matches[1], matches[2]);
} else {
window.opener.OAuthError("No token or state");
}
} finally {
window.close();
}
}
window.onload = parseLocation;
})();
</script>
</body>
</html>