mirror of
https://github.com/directus/directus.git
synced 2026-01-15 04:58:08 -05:00
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:
5
.changeset/lazy-zebras-dress.md
Normal file
5
.changeset/lazy-zebras-dress.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@directus/sdk": patch
|
||||
---
|
||||
|
||||
Removed invalid login provider option from the SDK
|
||||
@@ -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;
|
||||
|
||||
@@ -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) };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user