fix: use public wpUrl runtime config for auth refresh token mutation

This commit is contained in:
2026-01-28 21:09:37 -05:00
parent 065b729a2f
commit 2c86905c91
2 changed files with 6 additions and 2 deletions

View File

@@ -40,6 +40,10 @@ export default defineNuxtConfig({
colorMode: false, colorMode: false,
}, },
runtimeConfig: {
wpUrl,
},
compatibilityDate: "2026-01-01", compatibilityDate: "2026-01-01",
nitro: { nitro: {

View File

@@ -42,8 +42,8 @@ function getAuthUser(user: AuthUserFragment): User {
// Refresh auth token by calling remote GraphQL endpoint directly // Refresh auth token by calling remote GraphQL endpoint directly
export async function refreshAuthToken(refreshToken: string): Promise<string | undefined> { export async function refreshAuthToken(refreshToken: string): Promise<string | undefined> {
// TODO: const { public: { graphql: { endpoint } } } = useRuntimeConfig(); const { public: { wpUrl } } = useRuntimeConfig();
const endpoint = `${process.env.NUXT_WP_URL || "https://cultureat.ledevsimple.ca"}/graphql`; const endpoint = `${wpUrl}/graphql`;
const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>({ const { data } = await executeGraphQLHTTP<ResultOf<"AuthRefreshToken">>({
query: AuthRefreshTokenDocument, query: AuthRefreshTokenDocument,
variables: { refreshToken }, variables: { refreshToken },