2017-07-08 01:18:03 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="well">
|
2018-08-31 13:00:22 +00:00
|
|
|
<h2 style="margin-top: 0">{{_('Remote login')}}</h2>
|
2017-07-08 01:18:03 +00:00
|
|
|
<p>
|
2019-05-30 06:55:24 +00:00
|
|
|
{{_('Use your other device, login and visit ')}} <a href="{{verify_url}}">{{verify_url}}</a>.
|
2017-07-08 01:18:03 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{{_('Once you do so, you will automatically get logged in on this device.')}}
|
|
|
|
</p>
|
|
|
|
<p>
|
2019-05-26 09:31:09 +00:00
|
|
|
{{_('The link will expire after 10 minutes.')}}
|
2017-07-08 01:18:03 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block js %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
(function () {
|
|
|
|
// Poll the server to check if the user has authenticated
|
|
|
|
var t = setInterval(function () {
|
2019-02-09 17:46:36 +00:00
|
|
|
$.post('{{url_for("web.token_verified")}}', { token: '{{token}}' })
|
2017-07-08 01:18:03 +00:00
|
|
|
.done(function(response) {
|
|
|
|
if (response.status === 'success') {
|
|
|
|
// Wait a tick so cookies are updated
|
|
|
|
setTimeout(function () {
|
2019-02-09 17:46:36 +00:00
|
|
|
window.location.href = '{{url_for("web.index")}}';
|
2017-07-08 01:18:03 +00:00
|
|
|
}, 0);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.fail(function (xhr) {
|
|
|
|
clearInterval(t);
|
|
|
|
|
|
|
|
var response = JSON.parse(xhr.responseText);
|
|
|
|
alert(response.message);
|
|
|
|
});
|
|
|
|
}, 5000);
|
|
|
|
})()
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|