Fix double /api/ prefix in API endpoint calls
When VITE_API_URL=/api, axios baseURL is already set to /api. However, all endpoint calls included the /api/ prefix, creating double paths like /api/api/auth/login/. Removed /api/ prefix from 81 API endpoint calls across 22 files: - src/api/auth.ts - Fixed login, logout, me, refresh, hijack endpoints - src/api/client.ts - Fixed token refresh endpoint - src/api/profile.ts - Fixed all profile, email, password, MFA, sessions endpoints - src/hooks/*.ts - Fixed all remaining API calls (users, appointments, resources, etc) - src/pages/*.tsx - Fixed signup and email verification endpoints This ensures API requests use the correct path: /api/auth/login/ instead of /api/api/auth/login/ 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
43
frontend/test-production.spec.ts
Normal file
43
frontend/test-production.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('production login redirects to correct domain', async ({ page }) => {
|
||||
console.log('\n=== Testing Production Login Flow ===\n');
|
||||
|
||||
// Step 1: Navigate to login
|
||||
console.log('Step 1: Navigating to https://smoothschedule.com/login');
|
||||
await page.goto('https://smoothschedule.com/login');
|
||||
await page.waitForLoadState('networkidle');
|
||||
console.log(' Current URL:', page.url());
|
||||
|
||||
// Step 2: Fill credentials
|
||||
console.log('\nStep 2: Filling credentials (poduck@gmail.com / starry)');
|
||||
await page.fill('input[name="username"]', 'poduck@gmail.com');
|
||||
await page.fill('input[name="password"]', 'starry');
|
||||
|
||||
// Step 3: Click login
|
||||
console.log('\nStep 3: Clicking login button');
|
||||
await page.click('button[type="submit"]');
|
||||
|
||||
// Wait for navigation
|
||||
await page.waitForTimeout(3000);
|
||||
const finalUrl = page.url();
|
||||
console.log(' URL after login:', finalUrl);
|
||||
|
||||
// Check if we're on the correct domain
|
||||
if (finalUrl.includes('platform.smoothschedule.com')) {
|
||||
console.log('\n✅ SUCCESS! Redirected to platform.smoothschedule.com');
|
||||
} else if (finalUrl.includes('platform.lvh.me')) {
|
||||
console.log('\n❌ FAILED! Redirected to platform.lvh.me (wrong domain)');
|
||||
throw new Error('Redirect went to lvh.me instead of smoothschedule.com');
|
||||
} else if (finalUrl.includes('smoothschedule.com/login')) {
|
||||
console.log('\n⚠️ Still on login page - may indicate login failure');
|
||||
throw new Error('Still on login page after submitting credentials');
|
||||
} else {
|
||||
console.log('\n⚠️ Unexpected URL:', finalUrl);
|
||||
}
|
||||
|
||||
// Verify we're actually on platform.smoothschedule.com
|
||||
expect(finalUrl).toContain('platform.smoothschedule.com');
|
||||
|
||||
console.log('\n✅ Test PASSED!');
|
||||
});
|
||||
Reference in New Issue
Block a user