aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/base/base.html
diff options
context:
space:
mode:
authorSean Smith <ssmith@iol.unh.edu>2020-08-19 11:00:50 -0400
committerAdam Hassick <ahassick@iol.unh.edu>2020-12-04 14:20:41 -0500
commit99dfb2c0e97bce2f8827a6e8eef79b4abb60297a (patch)
tree1027fd9493400f9d1f545153f94d68ed3d27fd4b /src/templates/base/base.html
parent2418587ae1a7ad463988c14cc9b0d9a2f9cf0e95 (diff)
LFID login for both projects2.1.0-rc1
Signed-off-by: Sean Smith <ssmith@iol.unh.edu> Change-Id: I4a14dc75d7890a6d395b3f52177a7000ae1a2150
Diffstat (limited to 'src/templates/base/base.html')
-rw-r--r--src/templates/base/base.html45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/templates/base/base.html b/src/templates/base/base.html
index f86cff8..3ecad1a 100644
--- a/src/templates/base/base.html
+++ b/src/templates/base/base.html
@@ -44,25 +44,52 @@
{% endif %}
<i class="fas fa-caret-down rotate"></i>
</a>
- {% block login %}
<div class="dropdown-menu dropdown-menu-right">
- {% if user.is_authenticated %}
+ {% if LFID %}
+ {% if user.is_authenticated %}
<a href="{% url 'account:settings' %}" class="text-dark dropdown-item">
<i class="fas fa-cog"></i>
- Settings
+ Settings
</a>
- <a href="{% url 'account:logout' %}?next={{ request.path }}" class="text-dark dropdown-item">
+ <a id="logout_btn" href="#" method="post" class="text-dark dropdown-item">
<i class="fas fa-sign-out-alt"></i>
- Logout
+ Logout
</a>
- {% else %}
- <a href="{% url 'account:login' %}" class="text-dark dropdown-item">
+ <form id="logout_form" action="{% url 'oidc_logout' %}" method="post" style="visibility: hidden;">
+ {% csrf_token %}
+ <input type="submit" value="logout">
+ </form>
+ <script>
+ const logout_btn = document.getElementById("logout_btn");
+
+ const logout_form = document.getElementById("logout_form");
+
+ logout_btn.onclick = function() { logout_form.submit(); };
+ </script>
+ {% else %}
+ <a href="{% url 'oidc_authentication_init' %}" class="text-dark dropdown-item">
<i class="fas fa-sign-in-alt"></i>
- Login with Jira
+ Login with LFID
</a>
+ {% endif %}
+ {% else %}
+ {% if user.is_authenticated %}
+ <a href="{% url 'account:settings' %}" class="text-dark dropdown-item">
+ <i class="fas fa-cog"></i>
+ Settings
+ </a>
+ <a href="{% url 'account:logout' %}?next={{ request.path }}" class="text-dark dropdown-item">
+ <i class="fas fa-sign-out-alt"></i>
+ Logout
+ </a>
+ {% else %}
+ <a href="{% url 'account:login' %}" class="text-dark dropdown-item">
+ <i class="fas fa-sign-in-alt"></i>
+ Login with Jira
+ </a>
+ {% endif %}
{% endif %}
</div>
- {% endblock login %}
</li>
</ul>
</div>