Fix authentication with debug mode (#532)

Fix authent with debug mode
This commit is contained in:
Charles Bochet
2023-07-07 14:10:04 -07:00
committed by GitHub
parent c847bca293
commit f62fdc1219
4 changed files with 30 additions and 26 deletions

View File

@ -30,6 +30,7 @@ export interface Options<TCacheShape> extends ApolloClientOptions<TCacheShape> {
onUnauthenticatedError?: () => void;
extraLinks?: ApolloLink[];
isDebugMode?: boolean;
tokenPair: AuthTokenPair | null;
}
export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
@ -45,9 +46,12 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
onUnauthenticatedError,
extraLinks,
isDebugMode,
tokenPair,
...options
} = opts;
this.tokenPair = tokenPair;
const buildApolloLink = (): ApolloLink => {
const httpLink = createHttpLink({
uri,