fix: use public wpUrl runtime config for auth refresh token mutation
This commit is contained in:
@@ -40,6 +40,10 @@ export default defineNuxtConfig({
|
|||||||
colorMode: false,
|
colorMode: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
runtimeConfig: {
|
||||||
|
wpUrl,
|
||||||
|
},
|
||||||
|
|
||||||
compatibilityDate: "2026-01-01",
|
compatibilityDate: "2026-01-01",
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
|
|||||||
@@ -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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user