File tree Expand file tree Collapse file tree
frontend/app/src/pages/auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Button } from '@/components/v1/ui/button' ;
22import { Icons } from '@/components/v1/ui/icons' ;
3+ import useControlPlane from '@/hooks/use-control-plane.ts' ;
34import React from 'react' ;
45
56export type SocialAuthProvider = 'google' | 'github' ;
@@ -9,12 +10,12 @@ const PROVIDER_CONFIG: Record<
910 { href : string ; label : string ; icon : React . ReactNode }
1011> = {
1112 google : {
12- href : '/api/v1/ users/google/start' ,
13+ href : 'users/google/start' ,
1314 label : 'Google' ,
1415 icon : < Icons . google className = "size-4" /> ,
1516 } ,
1617 github : {
17- href : '/api/v1/ users/github/start' ,
18+ href : 'users/github/start' ,
1819 label : 'GitHub' ,
1920 icon : < Icons . gitHub className = "size-4" /> ,
2021 } ,
@@ -41,9 +42,12 @@ export function SocialAuthButton({
4142 provider : SocialAuthProvider ;
4243} ) {
4344 const cfg = PROVIDER_CONFIG [ provider ] ;
44-
45+ const { isControlPlaneEnabled } = useControlPlane ( ) ;
46+ const basePath = isControlPlaneEnabled
47+ ? '/api/v1/control-plane/'
48+ : '/api/v1/' ;
4549 return (
46- < a href = { cfg . href } className = "w-full" >
50+ < a href = { basePath + cfg . href } className = "w-full" >
4751 < Button
4852 variant = "outline"
4953 type = "button"
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { useMemo } from 'react';
77export default function useApiMeta ( ) {
88 const { isControlPlaneEnabled } = useControlPlane ( ) ;
99 const metaQuery = useQuery ( {
10- queryKey : [ 'metadata:get' ] ,
10+ queryKey : [ 'metadata:get' , isControlPlaneEnabled ] ,
1111 queryFn : async ( ) => {
1212 try {
1313 return await ( isControlPlaneEnabled
You can’t perform that action at this time.
0 commit comments