Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KSZK
DevTeam
vikoverflow
vikoverflow-backend
Commits
a6293440
Commit
a6293440
authored
May 19, 2020
by
Daniel Gal
Browse files
Fixed broken auth flow on page unload
parent
4bc4787e
Pipeline
#4021
passed with stage
in 4 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/account/views.py
View file @
a6293440
...
...
@@ -4,6 +4,7 @@ from rest_framework import permissions
from
rest_framework.decorators
import
action
from
rest_framework.response
import
Response
from
django.shortcuts
import
redirect
from
django.contrib.auth
import
logout
from
rest_framework.decorators
import
api_view
from
common.mixins
import
RelativeURLFieldMixin
...
...
@@ -19,6 +20,11 @@ def set_display_name(request):
if
len
(
request
.
session
.
values
())
==
0
:
return
Response
(
status
=
401
)
# Interrupt auth flow from browser
if
"cancel"
in
request
.
data
:
logout
(
request
)
return
Response
(
status
=
204
)
serializer
=
serializers
.
DisplayNameSerializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment