From b9ea116697d55f3a4b9b9e22bf3ee90c9036ef29 Mon Sep 17 00:00:00 2001 From: Stevche Radevski Date: Wed, 4 Sep 2024 18:05:56 +0200 Subject: [PATCH] fix: Remove deprecated method, generalize typings in auth (#8998) --- packages/core/js-sdk/src/auth/index.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/core/js-sdk/src/auth/index.ts b/packages/core/js-sdk/src/auth/index.ts index 95f08c014e..35a2842388 100644 --- a/packages/core/js-sdk/src/auth/index.ts +++ b/packages/core/js-sdk/src/auth/index.ts @@ -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 ) => { 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, - }) - } }