Browse Source

First round of implementing Surfconext

master
Joshua Rubingh 7 months ago
parent
commit
715de5a87c
  1. 25
      VRE/VRE/views.py

25
VRE/VRE/views.py

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
from django.http import HttpResponse
from django.template import Template
from django.template.context import RequestContext
def test_login_page(request):
template_string = '''<h1>Login test</h1>{% if user.is_authenticated %}
<p>Current user: {{ user.email }}</p>
<p><a href="{% url 'api:api-info' %}">API Status info</a></p>
<form action="{% url 'oidc_logout' %}" method="post">
{% csrf_token %}
<input type="submit" value="logout">
</form>
{% else %}
<p><a href="{% url 'api:api-info' %}">API Status info</a></p>
<a href="{% url 'api-login-surfconext' %}">Login</a>
{% endif %}'''
template = Template(template_string)
request_context = RequestContext(request)
request_context.push({"user": request.user})
return HttpResponse(template.render(request_context))
Loading…
Cancel
Save