Paulus Schoutsen 82e8ca2754
Alow setting up integrations during onboarding (#3163)
* Allow setting up integrations during onboarding

* Fix compress static

* Don't compress static files in CI

* Remove unused file

* Fix static compress disabled in CI build

* Work with new integration step

* Import fix

* Lint

* Upgrade HAWS to 4.1.1
2019-05-07 22:27:10 -07:00

28 lines
538 B
TypeScript

import { HomeAssistant } from "../types";
export interface AuthProvider {
name: string;
id: string;
type: string;
}
export interface Credential {
type: string;
}
export interface SignedPath {
path: string;
}
export const hassUrl = `${location.protocol}//${location.host}`;
export const getSignedPath = (
hass: HomeAssistant,
path: string
): Promise<SignedPath> => hass.callWS({ type: "auth/sign_path", path });
export const fetchAuthProviders = () =>
fetch("/auth/providers", {
credentials: "same-origin",
});