authelia/web/src/services/ResetPassword.ts
Amir Zarrinkafsh 3494353641
refactor(web): use absolute imports with aliases (#2100)
* refactor(web): use absolute imports with aliases

Refactors all of the TS/JS frontend to utilise absolute imports along with import aliases.
Each of the paths within `src` are represented with their own alias:

* @assets
* @components
* @constants (new)
* @hooks
* @layouts
* @models
* @services
* @themes
* @utils
* @views

`Routes.ts` and `constant.ts` have been relocated to the constants directory for consistency.
2021-06-19 10:20:43 +02:00

15 lines
609 B
TypeScript

import { InitiateResetPasswordPath, CompleteResetPasswordPath, ResetPasswordPath } from "@services/Api";
import { PostWithOptionalResponse } from "@services/Client";
export async function initiateResetPasswordProcess(username: string) {
return PostWithOptionalResponse(InitiateResetPasswordPath, { username });
}
export async function completeResetPasswordProcess(token: string) {
return PostWithOptionalResponse(CompleteResetPasswordPath, { token });
}
export async function resetPassword(newPassword: string) {
return PostWithOptionalResponse(ResetPasswordPath, { password: newPassword });
}