From 8d3bf6cd5d511fadfbdba17ff51c74716ff48bfd Mon Sep 17 00:00:00 2001 From: Brainslug Date: Mon, 18 Sep 2023 22:28:04 +0200 Subject: [PATCH] SDK Removed invalid login provider option (#19722) * Removed provider option * Create lazy-zebras-dress.md --------- Co-authored-by: Pascal Jufer --- .changeset/lazy-zebras-dress.md | 5 +++++ sdk/src/auth/composable.ts | 3 +-- sdk/src/rest/commands/auth/login.ts | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .changeset/lazy-zebras-dress.md diff --git a/.changeset/lazy-zebras-dress.md b/.changeset/lazy-zebras-dress.md new file mode 100644 index 0000000000..bf3616ef02 --- /dev/null +++ b/.changeset/lazy-zebras-dress.md @@ -0,0 +1,5 @@ +--- +"@directus/sdk": patch +--- + +Removed invalid login provider option from the SDK diff --git a/sdk/src/auth/composable.ts b/sdk/src/auth/composable.ts index 4c7ad1f386..c073fe72e2 100644 --- a/sdk/src/auth/composable.ts +++ b/sdk/src/auth/composable.ts @@ -113,8 +113,7 @@ export const authentication = (mode: AuthenticationMode = 'cookie', config: Part // TODO: allow for websocket only authentication resetStorage(); - const authPath = options.provider ? `/auth/login/${options.provider}` : '/auth/login'; - const requestUrl = getRequestUrl(client.url, authPath); + const requestUrl = getRequestUrl(client.url, '/auth/login'); const authData: Record = { email, password }; if ('otp' in options) authData['otp'] = options.otp; diff --git a/sdk/src/rest/commands/auth/login.ts b/sdk/src/rest/commands/auth/login.ts index 3198982341..84fd320925 100644 --- a/sdk/src/rest/commands/auth/login.ts +++ b/sdk/src/rest/commands/auth/login.ts @@ -3,7 +3,6 @@ import type { RestCommand } from '../../types.js'; export interface LoginOptions { otp?: string; - provider?: string; mode?: AuthenticationMode; } @@ -23,9 +22,8 @@ export const login = options: LoginOptions = {} ): RestCommand => () => { - const path = options.provider ? `/auth/login/${options.provider}` : '/auth/login'; const data: Record = { email, password }; if ('otp' in options) data['otp'] = options.otp; if ('mode' in options) data['mode'] = options.mode; - return { path, method: 'POST', body: JSON.stringify(data) }; + return { path: '/auth/login', method: 'POST', body: JSON.stringify(data) }; };