Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael William Coughlin
GraceDB Server
Commits
2c87e79a
Commit
2c87e79a
authored
5 years ago
by
Tanner Prestegard
Committed by
GraceDB
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ligoauth: rework logout view
parent
aae9bbc6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/urls.py
+5
-3
5 additions, 3 deletions
config/urls.py
gracedb/ligoauth/views.py
+1
-15
1 addition, 15 deletions
gracedb/ligoauth/views.py
gracedb/templates/navbar_frag.html
+1
-1
1 addition, 1 deletion
gracedb/templates/navbar_frag.html
with
7 additions
and
19 deletions
config/urls.py
+
5
−
3
View file @
2c87e79a
...
...
@@ -2,7 +2,7 @@ from django.conf import settings
from
django.conf.urls
import
url
,
include
from
django.contrib
import
admin
from
django.contrib.auth.views
import
l
ogout
from
django.contrib.auth.views
import
L
ogout
View
from
django.views.generic
import
TemplateView
# Import feeds
...
...
@@ -10,7 +10,9 @@ import core.views
from
events.feeds
import
EventFeed
,
feedview
import
events.reports
import
events.views
from
ligoauth.views
import
pre_login
,
post_login
,
shib_logout
,
manage_password
from
ligoauth.views
import
(
pre_login
,
post_login
,
manage_password
)
import
search.views
# Django admin auto-discover
...
...
@@ -51,7 +53,7 @@ urlpatterns = [
# Authentication
url
(
r
'
^login/$
'
,
pre_login
,
name
=
'
login
'
),
url
(
r
'
^post-login/$
'
,
post_login
,
name
=
'
post-login
'
),
url
(
r
'
^logout/$
'
,
shib_logout
,
name
=
'
logout
'
),
url
(
r
'
^logout/$
'
,
LogoutView
.
as_view
()
,
name
=
'
logout
'
),
# Password management
url
(
'
^manage-password/$
'
,
manage_password
,
name
=
'
manage-password
'
),
...
...
This diff is collapsed.
Click to expand it.
gracedb/ligoauth/views.py
+
1
−
15
View file @
2c87e79a
import
logging
from
django.conf
import
settings
from
django.contrib.auth
import
(
logout
,
get_user_model
,
update_session_auth_hash
,
)
from
django.contrib.auth
import
get_user_model
,
update_session_auth_hash
from
django.http
import
HttpResponseRedirect
,
HttpResponseForbidden
from
django.shortcuts
import
resolve_url
,
render
from
django.urls
import
reverse
...
...
@@ -84,18 +82,6 @@ def post_login(request):
return
HttpResponseRedirect
(
original_url
)
def
shib_logout
(
request
):
# Call Django logout function
logout
(
request
)
# Get original url where the logout button was pressed from
original_url
=
request
.
META
.
get
(
'
HTTP_REFERER
'
,
resolve_url
(
settings
.
LOGOUT_REDIRECT_URL
))
return
HttpResponseRedirect
(
original_url
)
@lvem_observers_only
(
superuser_allowed
=
True
)
def
manage_password
(
request
):
# Set up context dictionary
...
...
This diff is collapsed.
Click to expand it.
gracedb/templates/navbar_frag.html
+
1
−
1
View file @
2c87e79a
...
...
@@ -20,7 +20,7 @@
<li
id=
"nav-other"
><a
href=
"{% url "
other
"
%}"
>
Other
</a></li>
{% endif %}
{% if user.is_authenticated %}
<li
id=
"nav-logout"
><a
href=
"{% url "
logout
"
%}"
>
Logout
</a></li>
<li
id=
"nav-logout"
><a
href=
"{% url "
logout
"
%}
?
next=
{{
request.path
}}
"
>
Logout
</a></li>
<li
id=
"nav-user"
>
Authenticated as:
{% if user.first_name %}
{{ user.get_full_name }}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment