Reshuffle login flow to hopefully make things more robust
This commit is contained in:
parent
8ba413b317
commit
39246d5df0
@ -76,6 +76,7 @@
|
|||||||
$("#cast_button").show();
|
$("#cast_button").show();
|
||||||
$("#booth_logged_in_as").text("You are currently logged in as " + username + ".");
|
$("#booth_logged_in_as").text("You are currently logged in as " + username + ".");
|
||||||
castBallot();
|
castBallot();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function castBallot() {
|
function castBallot() {
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
function callback_complete(name) {
|
function callback_complete(name) {
|
||||||
window.location = "/";
|
window.location = "/";
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -23,18 +23,33 @@
|
|||||||
{% block basecontent %}
|
{% block basecontent %}
|
||||||
<div class="ui middle aligned center aligned grid" style="height: 100%;">
|
<div class="ui middle aligned center aligned grid" style="height: 100%;">
|
||||||
<div class="column" style="max-width: 400px;">
|
<div class="column" style="max-width: 400px;">
|
||||||
<div class="ui success message">
|
<div class="ui hidden success message">
|
||||||
<div class="header">Log in successful</div>
|
<div class="header">Log in successful</div>
|
||||||
<p>You have successfully logged in to your account.</p>
|
<p>You have successfully logged in to your account.</p>
|
||||||
<p>You may now close this window and return to your previous page.</p>
|
<p>You may now close this window and return to your previous page.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ui hidden error message">
|
||||||
|
<div class="header">Error logging in</div>
|
||||||
|
<p>Your log in details appear to be correct, however there was an unknown error while logging you in.</p>
|
||||||
|
<p>Please close this window try again. If the problem persists, contact your election administrator.</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
|
var result = window.opener.callback_complete("{{ session.user.name }}");
|
||||||
|
if (result) {
|
||||||
|
$(".success.message").removeClass("hidden");
|
||||||
|
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
window.close();
|
window.close();
|
||||||
window.opener.callback_complete("{{ session.user.name }}");
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
$(".error.message").removeClass("hidden");
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
$(".error.message").removeClass("hidden");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user