SDK Removed invalid login provider option (#19722)

* Removed provider option

* Create lazy-zebras-dress.md

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
Brainslug
2023-09-18 22:28:04 +02:00
committed by GitHub
parent 3967f9fe6f
commit 8d3bf6cd5d
3 changed files with 7 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/sdk": patch
---
Removed invalid login provider option from the SDK

View File

@@ -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<string, string> = { email, password };
if ('otp' in options) authData['otp'] = options.otp;

View File

@@ -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<AuthenticationData, Schema> =>
() => {
const path = options.provider ? `/auth/login/${options.provider}` : '/auth/login';
const data: Record<string, string> = { 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) };
};