File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -743,6 +743,21 @@ async def change_password(
743743 return standard_responses .Result ()
744744
745745
746+ @router .post ("/users/invalidate-password/{user_id}" , status_code = 201 )
747+ async def invalidate_password (
748+ user_id : str ,
749+ user : models_users .CoreUser = Depends (is_user_in (GroupType .admin )),
750+ db : AsyncSession = Depends (get_db ),
751+ ):
752+ """
753+ Invalidate one user's password.
754+ The concerned user should change their password with a different one to use our services again.
755+
756+ **This endpoint is only usable by administrators**
757+ """
758+ await cruds_users .update_should_user_change_password_by_id (db = db , user_id = user_id )
759+
760+
746761@router .post (
747762 "/users/migrate-mail" ,
748763 status_code = 204 ,
You can’t perform that action at this time.
0 commit comments