chore: split axios request options into platform (#3927)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Akash K
2024-03-22 13:42:41 +05:30
committed by GitHub
parent c89c2a5f5c
commit d19807b212
3 changed files with 21 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import { Observable } from "rxjs"
import { Component } from "vue"
import { getI18n } from "~/modules/i18n"
import * as E from "fp-ts/Either"
import { AxiosRequestConfig } from "axios"
/**
* A common (and required) set of fields that describe a user.
@@ -135,6 +136,15 @@ export type AuthPlatformDef = {
*/
getGQLClientOptions?: () => Partial<ClientOptions>
/**
* called by the platform to provide additional/different config options when
* sending requests with axios
* eg: SH needs to include cookies in the request, while Central doesn't and throws a cors error if it does
*
* @returns AxiosRequestConfig
*/
axiosPlatformConfig?: () => AxiosRequestConfig
/**
* Returns the string content that should be returned when the user selects to
* copy auth token from Developer Options.