增加了讨论区的 SSO 登录

This commit is contained in:
virusdefender
2015-10-20 20:09:23 +08:00
parent da54a1245b
commit 17f1820955
6 changed files with 43 additions and 30 deletions

View File

@@ -5,17 +5,13 @@
{% block body %}
<div class="container main">
<div class="text-center">
{% if request.user.is_authenticated %}
<p>3秒钟后将跳转到<span id="link">{{ callback }}</span></p>
<p>3秒钟后将使用账号{{ request.user.username }}登录<span id="link">{{ callback }}</span></p>
<button class="btn btn-warning" onclick="location.href='/'">取消登录</button>
<button class="btn btn-success" onclick="location.href='/login/'">更换账号</button>
<script>setTimeout(function(){
window.location.href = "{{ callback }}?token={{ token }}"},
window.location.href = "{{ redirect_url }}"},
3000);
</script>
{% else %}
<script>window.location.href = "/login/";</script>
{% endif %}
</div>
</div>
{% endblock %}