diff --git a/packages/login-redirect/package.json b/packages/login-redirect/package.json index 73d5d1dbd3..68a6ade474 100644 --- a/packages/login-redirect/package.json +++ b/packages/login-redirect/package.json @@ -14,7 +14,7 @@ "main": "index.js", "private": true, "scripts": { - "build": "rimraf dist && vite build", + "build": "rimraf dist && tsc && vite build", "dev": "vite --port 1234", "prepare": "yarn build" }, diff --git a/packages/login-redirect/src/login-redirect.ts b/packages/login-redirect/src/login-redirect.ts index ed0d1cb28f..60f2c7f6c3 100644 --- a/packages/login-redirect/src/login-redirect.ts +++ b/packages/login-redirect/src/login-redirect.ts @@ -1,6 +1,6 @@ -import { initializeClient } from '@altairgraphql/api-utils'; import { OAUTH_POPUP_CALLBACK_MESSAGE_TYPE } from '@altairgraphql/api-utils/build/constants'; import { closeWindow, getValidSource, isValidOpener } from './helpers'; +import { getAltairConfig } from 'altair-graphql-core/build/config'; const OAUTH_NONCE_KEY = 'altairgql:oauth:nonce:key'; @@ -73,7 +73,7 @@ const signInWithRedirect = (apiBaseUrl: string) => { }; export const initLoginRedirect = async () => { - const client = initializeClient( + const urlConfig = getAltairConfig().getUrlConfig( import.meta.env.DEV ? 'development' : 'production' ); @@ -86,7 +86,7 @@ export const initLoginRedirect = async () => { sessionStorage.setItem(OAUTH_NONCE_KEY, nonce); - return signInWithRedirect(client.options.apiBaseUrl); + return signInWithRedirect(urlConfig.api); } await sendToken(result.accessToken);