fix
diff --git a/app/dtps.js b/app/dtps.js
index 44492d4..86bb16d 100644
--- a/app/dtps.js
+++ b/app/dtps.js
@@ -17,8 +17,7 @@
clientSecret: "crCLyaH4vT8hXaRBLe80kJ6RoHCJPcZXXGnnpEDe7ypnnXBu7KuPHcEzPqygyhZS",
redirectURI: "https://dtps.js.org/app",
logout: function () {
- $.ajax({ url: 'https://cors-anywhere.herokuapp.com/http://lms.jottocraft.com/login/oauth2/token?access_token=' + dtps.oauth.token, type: 'DELETE' });
- window.location.href = "https://dtps.js.org"
+ $.ajax({ url: 'https://cors-anywhere.herokuapp.com/http://lms.jottocraft.com/login/oauth2/token?access_token=' + dtps.oauth.token, type: 'DELETE', success: function() { window.localStorage.removeItem("dtpsRefresh"); window.localStorage.removeItem("dtpsUser"); window.location.href = "https://dtps.js.org?logout=true" } });
}
},
latestStream: []
@@ -350,7 +349,7 @@
});
});
});
- });
+ }).fail(() => { window.localStorage.removeItem("dtpsRefresh"); window.localStorage.removeItem("dtpsUser"); dtps.init(); });
} else {
if (dtps.param.code && (dtps.param.state == "dtps-login")) {
$.post("https://cors-anywhere.herokuapp.com/http://lms.jottocraft.com/login/oauth2/token", { grant_type: "authorization_code", code: dtps.param.code, client_id: dtps.oauth.clientID, client_secret: dtps.oauth.clientSecret, redirect_uri: dtps.oauth.redirectURI }).done(function (data) {
@@ -1284,8 +1283,6 @@
<div style="display:inline-block;" class="beta badge notice contributor">contributor <i style="vertical-align: middle;" class="material-icons contributor">group</i></div>
<div style="display:inline-block;" class="beta badge notice og">OG <i style="vertical-align: middle;" class="material-icons og">star_border</i></div>
<!-- <div style="display:inline-block;" class="beta badge notice dev">developer <i style="vertical-align: middle;" class="material-icons dev">code</i></div> -->
- <br /> <br />
- <button onclick="window.location.href = '/logout'" class="btn"><i class="material-icons">exit_to_app</i> Logout</button>
<br /><br />
<h5>Credits</h5>
<ul>
diff --git a/index.html b/index.html
index dbbbeb1..1e1e1cb 100644
--- a/index.html
+++ b/index.html
@@ -67,12 +67,19 @@
</style>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="fluid.js"></script>
+ <script>
+ $(document).ready(function() {
+ if (window.localStorage.dtpsRefresh) {
+
+ }
+ })
+ </script>
<div style="padding: 0px 20px;" class="titlebar">
<img style="width: auto; height: 36px; margin-bottom: -6px; margin-right: 10px;" src="https://dtps.js.org/outline.png" />
<h3>Power+</h3>
<div onclick="window.location.href = 'https://chrome.google.com/webstore/detail/power%20/pakgdifknldaiglefmpkkgfjndemfapo';"><i class="material-icons">cloud_download</i> Install</div>
<div onclick="window.location.href='/canvas'"><img src="https://i.imgur.com/g36oHzm.png" /> Power+ for Canvas</div>
- <div onclick="window.location.href = 'http://lms.jottocraft.com/login/oauth2/auth?client_id=10000000000003&response_type=code&state=dtps-login&redirect_uri=https://dtps.js.org/app';"><i style="font-family: 'Material Icons Extended'" class="material-icons">lock_outline</i> Login</div>
+ <div onclick="window.location.href = '/app';"><i style="font-family: 'Material Icons Extended'" class="material-icons">lock_outline</i> Login</div>
</div>
<div style="text-align: center; margin-top: calc(50vh - 375px);">
<div id="mainIMG" style="width: 1000px;height: 640px;border-radius: 10px;margin-top: 50px;box-shadow: 0 10px 30px rgba(0, 0, 0, 0.17);margin: 50px auto;background-size: cover;"></div>