-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoauth.html
42 lines (40 loc) · 1.22 KB
/
oauth.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>Oauth</title>
<script src="jquery-3.2.1.min.js"></script>
<script src="//js.jotform.com/JotFormCustomWidget.min.js"></script>
<script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
<script src="utils.js"></script>
</head>
<body onload="load();">
<center> You can close this page. </center>
<form action="database.php" method="POST" enctype="multipart/form-data" id="key">
<input type="hidden" id="key" value="">
</form>
<script type="text/javascript">
function load() {
window.opener.document.getElementById("key").value = utils.parseQueryString(window.location.hash).access_token;
document.getElementById("key").value = utils.parseQueryString(window.location.hash).access_token;
window.opener.$("#key").trigger("change");
var key = document.getElementById("key").value;
var formdata = new FormData();
formdata.append("dbxkey",key);
$.ajax({
type: "POST",
url: "database.php",
enctype: "multipart/form-data",
data: formdata,
async: false,
cache: false,
contentType: false,
processData: false,
success: function (sccss) {
console.log(sccss);
}
});
$("#key").trigger("change");
}
</script>
</body>
</html>