mirror of
				https://github.com/hay-kot/homebox.git
				synced 2025-10-27 11:26:42 +00:00 
			
		
		
		
	feat: change password (#35)
* refactor: implement factories for testing * add additional factories * change protection for dropFields * prevent timed attacks on login * use switch instead of else-if * API implementation for changing password * add change-password dialog
This commit is contained in:
		
							parent
							
								
									a6e3989aee
								
							
						
					
					
						commit
						a6d2fd45df
					
				
					 19 changed files with 458 additions and 149 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| import { BaseAPI, route } from "../base"; | ||||
| import { UserOut } from "../types/data-contracts"; | ||||
| import { ChangePassword, UserOut } from "../types/data-contracts"; | ||||
| import { Result } from "../types/non-generated"; | ||||
| 
 | ||||
| export class UserApi extends BaseAPI { | ||||
|  | @ -14,4 +14,14 @@ export class UserApi extends BaseAPI { | |||
|   public delete() { | ||||
|     return this.http.delete<void>({ url: route("/users/self") }); | ||||
|   } | ||||
| 
 | ||||
|   public changePassword(current: string, newPassword: string) { | ||||
|     return this.http.put<ChangePassword, void>({ | ||||
|       url: route("/users/self/change-password"), | ||||
|       body: { | ||||
|         current, | ||||
|         new: newPassword, | ||||
|       }, | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue