Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
TO
Helios Server
Commits
358746af
Commit
358746af
authored
Oct 19, 2015
by
Shirlei Chaves
Browse files
Options
Downloads
Patches
Plain Diff
Fix user object not JSON serializable
Now using user_id on session
parent
2c100241
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
helios_auth/auth_systems/password.py
+5
-4
5 additions, 4 deletions
helios_auth/auth_systems/password.py
with
5 additions
and
4 deletions
helios_auth/auth_systems/password.py
+
5
−
4
View file @
358746af
...
...
@@ -57,7 +57,7 @@ def password_login_view(request):
try
:
user
=
User
.
get_by_type_and_id
(
'
password
'
,
username
)
if
password_check
(
user
,
password
):
request
.
session
[
'
password_user
'
]
=
user
request
.
session
[
'
password_user
_id
'
]
=
user
.
id
return
HttpResponseRedirect
(
reverse
(
after
))
except
User
.
DoesNotExist
:
pass
...
...
@@ -104,9 +104,10 @@ def get_auth_url(request, redirect_url = None):
return
reverse
(
password_login_view
)
def
get_user_info_after_auth
(
request
):
user
=
request
.
session
[
'
password_user
'
]
del
request
.
session
[
'
password_user
'
]
user_info
=
user
.
info
from
helios_auth.models
import
User
user_id
=
request
.
session
[
'
password_user_id
'
]
user
=
User
.
objects
.
get
(
id
=
request
.
session
[
'
password_user_id
'
])
del
request
.
session
[
'
password_user_id
'
]
return
{
'
type
'
:
'
password
'
,
'
user_id
'
:
user
.
user_id
,
'
name
'
:
user
.
name
,
'
info
'
:
user
.
info
,
'
token
'
:
None
}
...
...
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