From 094d3e0e1370f2f8b3619ba6cea8b33ac83dceed Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 12 Jan 2024 14:54:22 -0500 Subject: Update frontend --- fig-frontend/client/src/components/login.ts | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 fig-frontend/client/src/components/login.ts (limited to 'fig-frontend/client/src/components/login.ts') diff --git a/fig-frontend/client/src/components/login.ts b/fig-frontend/client/src/components/login.ts new file mode 100644 index 0000000..195c97f --- /dev/null +++ b/fig-frontend/client/src/components/login.ts @@ -0,0 +1,34 @@ +import { html, css, LitElement } from "lit"; +import { customElement } from "lit/decorators.js"; + +import * as Config from "../config"; +import * as Twitch from "../twitch"; + +@customElement("fig-login") +export class Login extends LitElement { + static styles = css` + `; + + login() { + Twitch.startTwitchAuth(); + } + + async check() { + const resp = await fetch(`${Config.API_URL}/check`); + console.log(await resp.text()); + } + + render() { + const token = Twitch.getAuthToken(); + console.log(token); + if (token) { + return html` + +`; + } else { + return html` + +`; + } + } +} -- cgit v1.2.3