UNPKG

ashish-sdk

Version:
27 lines 1.04 kB
// eslint-disable-next-line import/no-cycle import { EndPoints } from '../auth'; export function fetchSessionInfoService(authVerificationUrl) { return fetch(authVerificationUrl, { credentials: 'include', }); } export async function fetchAuthTokenService(authEndpoint) { return fetch(authEndpoint); } export async function fetchAuthService(thoughtSpotHost, username, authToken) { return fetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, { credentials: 'include', }); } export async function fetchBasicAuthService(thoughtSpotHost, username, password) { return fetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded', 'x-requested-by': 'ThoughtSpot', }, body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`, credentials: 'include', }); } //# sourceMappingURL=authService.js.map