Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bisago-be
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
ppl-fasilkom-ui
IT Project 2020
Group C
bisago-be
Commits
dd1553d5
Commit
dd1553d5
authored
4 years ago
by
Bimo Iman Smartadi
Browse files
Options
Downloads
Patches
Plain Diff
[REFACTOR] Removed commented code
parent
2d084967
Branches
oauth_and_refactor_code_smell
No related tags found
1 merge request
!58
Oauth and refactor code smell
Pipeline
#55459
passed with warnings
4 years ago
Stage: test
Stage: linter
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
oauth/views.py
+2
-18
2 additions, 18 deletions
oauth/views.py
with
2 additions
and
18 deletions
oauth/views.py
+
2
−
18
View file @
dd1553d5
...
...
@@ -57,22 +57,7 @@ def request_token(request):
else
:
response
[
"
response
"
]
=
"
Wrong password
"
return
JsonResponse
(
response
,
status
=
400
)
'''
if user.is_active:
#token = RefreshToken(user)
payload = {
'
username
'
:email,
'
password
'
:user.password}
token = requests.post(
"
/request-token/
"
, data=payload)
token = token[
'
token
'
]
response = {}
response[
'
username
'
] = user.username
response[
'
token
'
] = token
#response[
'
refresh_token
'
] = str(token)
return JsonResponse(response, status=200)
else:
response[
"
response
"
] =
"
Please activate your account
"
return JsonResponse(response, status=404)
'''
@csrf_exempt
def
_request_token_from_google
(
email
,
access_token
):
payload
=
{
'
access_token
'
:
access_token
}
# validate the token
...
...
@@ -92,7 +77,7 @@ def _request_token_from_google(email, access_token):
BisaGoUser
.
objects
.
create
(
user
=
user
,
phone_number
=
random_generated_phone_number
)
return
user
,
200
'''
@csrf_exempt
def
validate_google_token
(
email
,
access_token
):
payload
=
{
'
access_token
'
:
access_token
}
# validate the token
...
...
@@ -102,7 +87,6 @@ def validate_google_token(email, access_token):
content
=
{
'
message
'
:
'
wrong google token / this google token is already expired.
'
}
return
None
,
JsonResponse
(
content
,
status
=
404
)
return
User
.
objects
.
get
(
email
=
email
)
'''
...
...
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