import { state, property } from "lit/decorators.js"; import { msg, localized } from "@lit/localize"; import LiteElement, { html } from "../utils/LiteElement"; import type { AuthState, LoggedInEvent } from "../utils/AuthService"; import AuthService from "../utils/AuthService"; @localized() export class SignUp extends LiteElement { @property({ type: Object }) authState?: AuthState; @state() isSignedUpWithoutAuth?: boolean; render() { return html`
${this.isSignedUpWithoutAuth ? html`

${msg( "Click the link in the verification email we sent you to log in." )}

` : html`

${msg("Sign up")}

`}
`; } private onSubmit() { if (this.authState) { this.dispatchEvent( new CustomEvent("log-out", { detail: { redirect: false } }) ); } } private onAuthenticated(event: LoggedInEvent) { this.dispatchEvent( AuthService.createLoggedInEvent({ ...event.detail, firstLogin: true, }) ); } private onUnauthenticated() { this.isSignedUpWithoutAuth = true; } }