* 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
28 lines
538 B
TypeScript
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",
|
|
});
|