diff options
Diffstat (limited to 'code/app/src/lib/api/password-reset-request')
| -rw-r--r-- | code/app/src/lib/api/password-reset-request/index.ts | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/code/app/src/lib/api/password-reset-request/index.ts b/code/app/src/lib/api/password-reset-request/index.ts index 9d6f0dc..53cb1d2 100644 --- a/code/app/src/lib/api/password-reset-request/index.ts +++ b/code/app/src/lib/api/password-reset-request/index.ts @@ -1,17 +1,14 @@ -import { api_base } from "$lib/configuration"; -import { http_get_async, http_post_async, type InternalFetchResponse } from "../_fetch"; +import {api_base} from "$lib/configuration"; +import {http_get_async, http_post_async} from "../_fetch"; export const http_password_reset_request = { - create_forgot_password_request(username: string): Promise<InternalFetchResponse> { - if (!username) throw new Error("Username is empty"); - return http_get_async(api_base("_/forgot-password-requests/create?username=" + username)); + create_request_async(username: string): Promise<Response> { + return http_get_async(api_base("_/password-reset-request/create?for_user=" + username)); }, - check_forgot_password_request(public_id: string): Promise<InternalFetchResponse> { - if (!public_id) throw new Error("Id is empty"); - return http_get_async(api_base("_/forgot-password-requests/is-valid?id=" + public_id)); + check_request_async(publicId: string): Promise<Response> { + return http_get_async(api_base("_/password-reset-request/is-valid?id=" + publicId)); }, - fulfill_forgot_password_request(public_id: string, newPassword: string): Promise<InternalFetchResponse> { - if (!public_id) throw new Error("Id is empty"); - return http_post_async(api_base("_/forgot-password-requests/fulfill"), { id: public_id, newPassword }); + fulfill_request_async(publicId: string, newPassword: string): Promise<Response> { + return http_post_async(api_base("_/password-reset-request/fulfill"), {id: publicId, newPassword}); }, -}
\ No newline at end of file +};
\ No newline at end of file |
