Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ssoauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
ssoauth
Commits
c3d416d1
Commit
c3d416d1
authored
7 years ago
by
Art
Browse files
Options
Downloads
Patches
Plain Diff
Prevent onelogin toolkit breaking from lazy url resolvers.
parent
daf11a8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ssoauth/views.py
+7
-3
7 additions, 3 deletions
ssoauth/views.py
with
7 additions
and
3 deletions
ssoauth/views.py
+
7
−
3
View file @
c3d416d1
...
...
@@ -63,15 +63,19 @@ class LogInView(SAMLMixin, View):
def
get_next_url
(
request
):
next_url
=
request
.
GET
.
get
(
REDIRECT_FIELD_NAME
,
None
)
or
conf
.
settings
.
LOGIN_REDIRECT_URL
or
"
/
"
logger
.
debug
(
"
Will ask IDP to redirect after login to: {}
"
.
format
(
next_url
))
return
next_url
return
str
(
next_url
)
class
LogOutView
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
contrib_auth
.
logout
(
request
)
return
http
.
HttpResponseRedirect
(
self
.
get_next_url
(
request
))
@staticmethod
def
get_next_url
(
request
):
next_url
=
request
.
GET
.
get
(
REDIRECT_FIELD_NAME
,
None
)
or
conf
.
settings
.
LOGOUT_REDIRECT_URL
or
"
/
"
return
http
.
HttpResponseRedirect
(
next_url
)
return
str
(
next_url
)
@method_decorator
(
never_cache
,
"
dispatch
"
)
...
...
@@ -101,7 +105,7 @@ class ACSAuthNView(SAMLMixin, View):
logger
.
warning
(
"
Did not receive RelayState (redirect target) from the IDP.
"
)
next_url
=
conf
.
settings
.
LOGOUT_REDIRECT_URL
or
"
/
"
logger
.
debug
(
"
From ACS redirecting to {}
"
.
format
(
next_url
))
return
next_url
return
str
(
next_url
)
def
log_in_user
(
self
,
request
,
auth
):
...
...
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