fix: Remove deprecated method, generalize typings in auth (#8998)

This commit is contained in:
Stevche Radevski
2024-09-04 18:05:56 +02:00
committed by GitHub
parent ed26fb4d19
commit b9ea116697

View File

@@ -12,8 +12,8 @@ export class Auth {
}
register = async (
actor: "customer" | "user",
method: "emailpass",
actor: string,
method: string,
payload: HttpTypes.AdminSignUpWithEmailPassword
) => {
const { token } = await this.client.fetch<{ token: string }>(
@@ -64,8 +64,8 @@ export class Auth {
// The callback expects all query parameters from the Oauth callback to be passed to the backend, and the provider is in charge of parsing and validating them
callback = async (
actor: "customer" | "user",
method: "emailpass",
actor: string,
method: string,
query?: Record<string, unknown>
) => {
const { token } = await this.client.fetch<{ token: string }>(
@@ -98,15 +98,4 @@ export class Auth {
this.client.clearToken()
}
create = async (
actor: "customer" | "user",
method: "emailpass",
payload: { email: string; password: string }
): Promise<{ token: string }> => {
return await this.client.fetch(`/auth/${actor}/${method}`, {
method: "POST",
body: payload,
})
}
}