Created
December 15, 2021 10:32
-
-
Save tjmonsi/6ca4d1875854d2c9227eea6ef7561853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement, html } from 'lit'; | |
import { state } from '../../worker/index.js'; | |
export class Page extends LitElement { | |
connectedCallback () { | |
super.connectedCallback(); | |
this.logout(); | |
} | |
async logout () { | |
const result = await window.fetch('/auth/logout'); | |
await state.set('token', null); | |
await state.set('username', null); | |
const el = document.querySelector('small-router'); | |
el.changeUrl('/'); | |
} | |
} | |
window.customElements.define('logout-page', Page); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment