Skip to content
2 changes: 1 addition & 1 deletion src/modules/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down