From 5782ab8a77519c806c42e8d26977785f6ad6e0c0 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Wed, 22 Nov 2023 07:01:15 +0800 Subject: [PATCH] fix: cors --- ee/tabby-ui/lib/tabby-gql-client.ts | 2 +- ee/tabby-webserver/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/tabby-ui/lib/tabby-gql-client.ts b/ee/tabby-ui/lib/tabby-gql-client.ts index 2fac2f1..711687d 100644 --- a/ee/tabby-ui/lib/tabby-gql-client.ts +++ b/ee/tabby-ui/lib/tabby-gql-client.ts @@ -3,7 +3,7 @@ import { GraphQLClient, Variables, RequestOptions } from 'graphql-request' export const graphQLClient = new GraphQLClient( `${process.env.NEXT_PUBLIC_TABBY_SERVER_URL ?? ''}/graphql`, { - credentials: 'include', + // credentials: 'include', mode: 'cors' } ) diff --git a/ee/tabby-webserver/src/lib.rs b/ee/tabby-webserver/src/lib.rs index a9acd21..e7699ae 100644 --- a/ee/tabby-webserver/src/lib.rs +++ b/ee/tabby-webserver/src/lib.rs @@ -46,11 +46,11 @@ pub async fn attach_webserver( "/graphql", routing::post(graphql::>).with_state(ctx.clone()), ) + .route("/graphql", routing::get(playground("/graphql", None))) .layer(Extension(schema)) .route("/hub", routing::get(ws_handler).with_state(ctx.clone())); let ui = ui - .route("/graphql", routing::get(playground("/graphql", None))) .route("/graphiql", routing::get(graphiql("/graphql", None))) .fallback(ui::handler);