Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NACSOS Core
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MCC APSIS
NACSOS
NACSOS Core
Commits
6a531ff8
Commit
6a531ff8
authored
1 year ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
improve security handling and add token handling options
parent
2f46aa2f
No related branches found
No related tags found
1 merge request
!41
Master
Pipeline
#1444
failed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/api/routes/users.py
+2
-2
2 additions, 2 deletions
server/api/routes/users.py
with
2 additions
and
2 deletions
server/api/routes/users.py
+
2
−
2
View file @
6a531ff8
...
...
@@ -78,11 +78,11 @@ async def save_user(user: UserInDBModel | UserModel, current_user: UserModel = D
@router.put
(
'
/my-details
'
,
response_model
=
str
)
async
def
save_user_self
(
user
:
UserInDBModel
|
UserModel
,
current_user
:
UserModel
=
Depends
(
get_current_active_user
)):
if
current_user
.
user_id
!=
user
.
user_id
:
if
str
(
current_user
.
user_id
)
!=
str
(
user
.
user_id
)
:
raise
UserPermissionError
(
'
This is not you!
'
)
async
with
db_engine
.
session
()
as
session
:
# type: AsyncSession
user_db
:
User
|
None
=
(
await
session
.
scalars
(
select
(
User
).
where
(
User
.
user_id
==
user
.
user_id
))).
one_or_none
()
user_db
:
User
|
None
=
(
await
session
.
scalars
(
select
(
User
).
where
(
User
.
user_id
==
str
(
user
.
user_id
)))
)
.
one_or_none
()
password
:
str
|
None
=
getattr
(
user
,
'
password
'
,
None
)
if
password
is
not
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