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>
91 lines
2.2 KiB
TypeScript
91 lines
2.2 KiB
TypeScript
/**
|
|
* Platform OAuth Settings API
|
|
*/
|
|
|
|
import apiClient from './client';
|
|
|
|
export interface OAuthProviderConfig {
|
|
enabled: boolean;
|
|
client_id: string;
|
|
client_secret: string;
|
|
// Apple-specific fields
|
|
team_id?: string;
|
|
key_id?: string;
|
|
// Microsoft-specific field
|
|
tenant_id?: string;
|
|
}
|
|
|
|
export interface PlatformOAuthSettings {
|
|
// Global setting
|
|
oauth_allow_registration: boolean;
|
|
|
|
// Provider configurations
|
|
google: OAuthProviderConfig;
|
|
apple: OAuthProviderConfig;
|
|
facebook: OAuthProviderConfig;
|
|
linkedin: OAuthProviderConfig;
|
|
microsoft: OAuthProviderConfig;
|
|
twitter: OAuthProviderConfig;
|
|
twitch: OAuthProviderConfig;
|
|
}
|
|
|
|
export interface PlatformOAuthSettingsUpdate {
|
|
oauth_allow_registration?: boolean;
|
|
|
|
// Google
|
|
oauth_google_enabled?: boolean;
|
|
oauth_google_client_id?: string;
|
|
oauth_google_client_secret?: string;
|
|
|
|
// Apple
|
|
oauth_apple_enabled?: boolean;
|
|
oauth_apple_client_id?: string;
|
|
oauth_apple_client_secret?: string;
|
|
oauth_apple_team_id?: string;
|
|
oauth_apple_key_id?: string;
|
|
|
|
// Facebook
|
|
oauth_facebook_enabled?: boolean;
|
|
oauth_facebook_client_id?: string;
|
|
oauth_facebook_client_secret?: string;
|
|
|
|
// LinkedIn
|
|
oauth_linkedin_enabled?: boolean;
|
|
oauth_linkedin_client_id?: string;
|
|
oauth_linkedin_client_secret?: string;
|
|
|
|
// Microsoft
|
|
oauth_microsoft_enabled?: boolean;
|
|
oauth_microsoft_client_id?: string;
|
|
oauth_microsoft_client_secret?: string;
|
|
oauth_microsoft_tenant_id?: string;
|
|
|
|
// Twitter (X)
|
|
oauth_twitter_enabled?: boolean;
|
|
oauth_twitter_client_id?: string;
|
|
oauth_twitter_client_secret?: string;
|
|
|
|
// Twitch
|
|
oauth_twitch_enabled?: boolean;
|
|
oauth_twitch_client_id?: string;
|
|
oauth_twitch_client_secret?: string;
|
|
}
|
|
|
|
/**
|
|
* Get platform OAuth settings
|
|
*/
|
|
export const getPlatformOAuthSettings = async (): Promise<PlatformOAuthSettings> => {
|
|
const { data } = await apiClient.get('/platform/settings/oauth/');
|
|
return data;
|
|
};
|
|
|
|
/**
|
|
* Update platform OAuth settings
|
|
*/
|
|
export const updatePlatformOAuthSettings = async (
|
|
settings: PlatformOAuthSettingsUpdate
|
|
): Promise<PlatformOAuthSettings> => {
|
|
const { data } = await apiClient.post('/platform/settings/oauth/', settings);
|
|
return data;
|
|
};
|