fix: Remove deprecated method, generalize typings in auth (#8998)
This commit is contained in:
@@ -12,8 +12,8 @@ export class Auth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
register = async (
|
register = async (
|
||||||
actor: "customer" | "user",
|
actor: string,
|
||||||
method: "emailpass",
|
method: string,
|
||||||
payload: HttpTypes.AdminSignUpWithEmailPassword
|
payload: HttpTypes.AdminSignUpWithEmailPassword
|
||||||
) => {
|
) => {
|
||||||
const { token } = await this.client.fetch<{ token: string }>(
|
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
|
// 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 (
|
callback = async (
|
||||||
actor: "customer" | "user",
|
actor: string,
|
||||||
method: "emailpass",
|
method: string,
|
||||||
query?: Record<string, unknown>
|
query?: Record<string, unknown>
|
||||||
) => {
|
) => {
|
||||||
const { token } = await this.client.fetch<{ token: string }>(
|
const { token } = await this.client.fetch<{ token: string }>(
|
||||||
@@ -98,15 +98,4 @@ export class Auth {
|
|||||||
|
|
||||||
this.client.clearToken()
|
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,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user