mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	feature: add password reset token endpoint to the admin panel (#2171)
* add password reset token endpoint to the admin panel * add None check on token * add localization message for passowrd reset link button
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| import { BaseCRUDAPI } from "../base/base-clients"; | ||||
| import { UnlockResults, UserIn, UserOut } from "~/lib/api/types/user"; | ||||
| import { ForgotPassword, PasswordResetToken, UnlockResults, UserIn, UserOut } from "~/lib/api/types/user"; | ||||
|  | ||||
| const prefix = "/api"; | ||||
|  | ||||
| @@ -7,6 +7,7 @@ const routes = { | ||||
|   adminUsers: `${prefix}/admin/users`, | ||||
|   adminUsersId: (tag: string) => `${prefix}/admin/users/${tag}`, | ||||
|   adminResetLockedUsers: (force: boolean) => `${prefix}/admin/users/unlock?force=${force ? "true" : "false"}`, | ||||
|   adminPasswordResetToken: `${prefix}/admin/users/password-reset-token`, | ||||
| }; | ||||
|  | ||||
| export class AdminUsersApi extends BaseCRUDAPI<UserIn, UserOut, UserOut> { | ||||
| @@ -16,4 +17,8 @@ export class AdminUsersApi extends BaseCRUDAPI<UserIn, UserOut, UserOut> { | ||||
|   async unlockAllUsers(force = false) { | ||||
|     return await this.requests.post<UnlockResults>(routes.adminResetLockedUsers(force), {}); | ||||
|   } | ||||
|  | ||||
|   async generatePasswordResetToken(payload: ForgotPassword) { | ||||
|     return await this.requests.post<PasswordResetToken>(routes.adminPasswordResetToken, payload); | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user