UNPKG

cluedin-widget

Version:

This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.

26 lines (21 loc) 675 B
import { authWithoutCreds, appFrontApiRequest } from '../helpers/request'; export function login(username, password, clientId) { const encodedUsername = encodeURIComponent(username); return authWithoutCreds('POST', 'token') .type('form') .send({ grant_type: 'password', username: username, password: password, client_id: clientId, }) .then((resp) => (resp.body)); } export function getTeamDomain(clientId) { return authWithoutCreds('GET', `api/account/available?clientId=${clientId}`).then((resp) => ( resp.body )); } export function saveToken(authData) { return appFrontApiRequest('POST', 'token').send(authData); }