Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
tbcare
tbcare-backend
Commits
240b9fda
Commit
240b9fda
authored
Jun 24, 2021
by
jahnsmichael
Browse files
[REFACTOR] add swagger auto schema for authentication
parent
b826ec8c
Pipeline
#83178
passed with stages
in 2 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/custom_auth/views.py
View file @
240b9fda
from
rest_framework.authtoken.views
import
ObtainAuthToken
from
rest_framework.authtoken.models
import
Token
from
rest_framework.authtoken.serializers
import
AuthTokenSerializer
from
rest_framework.response
import
Response
from
rest_framework
import
status
from
drf_yasg.utils
import
swagger_auto_schema
class
CustomAuthToken
(
ObtainAuthToken
):
@
swagger_auto_schema
(
request_body
=
AuthTokenSerializer
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
request_data
=
request
.
data
request_data
[
"username"
]
=
request_data
[
"username"
].
lower
()
...
...
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