diff --git a/src/modules/auth.ts b/src/modules/auth.ts index 0eae2b5..bdc9950 100644 --- a/src/modules/auth.ts +++ b/src/modules/auth.ts @@ -123,7 +123,7 @@ export function createAuthModule( * @param turnstileToken - Optional Turnstile captcha token * @returns Login response with access_token and user */ - async loginViaUsernamePassword( + async loginViaEmailPassword( email: string, password: string, turnstileToken?: string diff --git a/tests/unit/auth.test.js b/tests/unit/auth.test.js index e546fed..9f118e7 100644 --- a/tests/unit/auth.test.js +++ b/tests/unit/auth.test.js @@ -400,7 +400,7 @@ describe('Auth Module', () => { }); }); - describe('loginViaUsernamePassword()', () => { + describe('loginViaEmailPassword()', () => { test('should login successfully with email and password', async () => { const loginData = { email: 'test@example.com', @@ -421,7 +421,7 @@ describe('Auth Module', () => { .reply(200, mockResponse); // Call the API - const result = await base44.auth.loginViaUsernamePassword( + const result = await base44.auth.loginViaEmailPassword( loginData.email, loginData.password ); @@ -462,7 +462,7 @@ describe('Auth Module', () => { .reply(200, mockResponse); // Call the API - const result = await base44.auth.loginViaUsernamePassword( + const result = await base44.auth.loginViaEmailPassword( loginData.email, loginData.password, loginData.turnstile_token @@ -495,7 +495,7 @@ describe('Auth Module', () => { // Call the API and expect an error await expect( - base44.auth.loginViaUsernamePassword(loginData.email, loginData.password) + base44.auth.loginViaEmailPassword(loginData.email, loginData.password) ).rejects.toThrow(); // Verify all mocks were called @@ -514,7 +514,7 @@ describe('Auth Module', () => { // Call the API and expect an error await expect( - base44.auth.loginViaUsernamePassword(loginData.email, loginData.password) + base44.auth.loginViaEmailPassword(loginData.email, loginData.password) ).rejects.toThrow(); // Verify all mocks were called