-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added a password update route #15
Conversation
Added a template class for automatic creation date resolution
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 89.27% 90.27% +0.99%
==========================================
Files 16 16
Lines 457 442 -15
==========================================
- Hits 408 399 -9
+ Misses 49 43 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi there, thanks for the PR. (you are so fast I was willing to try this issue :D) I review it soon and come back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me.
@@ -54,3 +54,14 @@ async def create_user(user_table: Table, payload: UserAuth): | |||
pwd = await security.hash_password(payload.password) | |||
payload = UserCreation(username=payload.username, hashed_password=pwd, scopes=payload.scopes) | |||
return await create_entry(user_table, payload) | |||
|
|||
|
|||
async def update_user_pwd(user_table: Table, payload: UserCred, entry_id: int = Path(..., gt=0)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One should create another file to store those methods that do the interface between routing and crud. In my PR I added some lines in this file too. If this continue, the file will end up quite big.
This PR adds the possibility of password update by:
/update-me
route to/update-info
for coherence_CreatedAt
and using multi-inheritance to avoid unneeded code duplicationI should bring your attention to route naming: I made the choice mentioned above but perhaps we should clarify the naming of all user routes since it's a complicated table.
Any feedback is welcome!