Skip to content

Commit 5728b3d

Browse files
author
Spencer Hawkins
committed
oops, actually do the logout
1 parent 5c9c2f9 commit 5728b3d

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/*

dist/js/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,19 @@ var authRequest = function() {
137137
console.log(data.request)
138138
},
139139
error: function(xhr, status, err) {
140-
$("#token-req-button").removeClass("btn-primary").addClass("btn-success").val("Request Token").prop('disabled', false)
141140
$("#token-loading").css("opacity", "0")
142141
console.log("error! " + status)
143142
console.log(xhr)
144143
console.log(status)
145144
console.log(err)
146145
if (xhr.responseJSON.error.includes("no user found")) {
146+
$("#token-req-button").removeClass("btn-primary").addClass("btn-success").val("Request Token").prop('disabled', false)
147147
toastr.error("User not found.<br>Note that you must have used MTGATracker to track at least one game in order to log in!")
148148
} else if (xhr.responseJSON.error.includes("discord mapping not found")) {
149+
$("#token-req-button").addClass("btn-primary").removeClass("btn-success").val("Redirecting...").prop('disabled', true)
149150
window.location.href = 'https://github.com/shawkinsl/mtga-tracker/blob/user/shawkins/inspector/logging_in.md';
150151
} else {
152+
$("#token-req-button").removeClass("btn-primary").addClass("btn-success").val("Request Token").prop('disabled', false)
151153
toastr.error("An unknown error occurred, please try again")
152154
}
153155
}

dist/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pages/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
6868
</li>
6969
<li class="divider"></li>
70-
<li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
70+
<li><a onclick="logout()"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
7171
</li>
7272
</ul>
7373
<!-- /.dropdown-user -->

0 commit comments

Comments
 (0)