refactor(auth): use centralized config for API base URL
Replace inline SECUIRD_API constant definitions with imported config module across all auth pages. This consolidates API URL configuration into a single source of truth.
This commit is contained in:
@@ -24,10 +24,7 @@ import {
|
||||
import { AddPasskeyWizard } from "@/components/security/AddPasskeyWizard";
|
||||
import { TotpEnrollmentWizard } from "@/components/security/TotpEnrollmentWizard";
|
||||
import { OAuthProvider } from "@/lib/oauth";
|
||||
|
||||
type LoginStep = 'credentials' | 'totp' | 'webauthn' | 'passkey-email' | 'mfa-enrollment' | 'mfa';
|
||||
|
||||
const SECUIRD_API = import.meta.env.VITE_API_BASE_URL ?? 'http://localhost:5000/api/v1';
|
||||
import { config } from "@/config";
|
||||
|
||||
/**
|
||||
* Complete an OIDC authorization flow after the user has authenticated.
|
||||
@@ -35,7 +32,7 @@ const SECUIRD_API = import.meta.env.VITE_API_BASE_URL ?? 'http://localhost:5000/
|
||||
* the auth code and returns the redirect URL for the calling application.
|
||||
*/
|
||||
async function completeOidcFlow(oidcSessionId: string, token: string): Promise<string> {
|
||||
const res = await fetch(`${SECUIRD_API}/oidc/complete`, {
|
||||
const res = await fetch(`${config.api.baseUrl}/oidc/complete`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ oidc_session_id: oidcSessionId, token }),
|
||||
|
||||
Reference in New Issue
Block a user