
* Svelte: WIP * WIP * WIP * WIP * WIP * WIP * Finished * Remove redundant code * Fix typo * Re-add routes * Form margin * Mobile nicities * Mobile changed * Increase keepalvie * Update Guild.svelte * Update Whitelabel.svelte * Whitelabel changes
21 lines
531 B
Svelte
21 lines
531 B
Svelte
<script>
|
|
import {clearLocalStorage, setDefaultHeaders} from '../includes/Auth.svelte'
|
|
import axios from "axios";
|
|
import {API_URL} from "../js/constants";
|
|
import {errorPage} from "../js/util";
|
|
|
|
setDefaultHeaders();
|
|
|
|
async function process() {
|
|
const res = await axios.post(`${API_URL}/logout`);
|
|
if (res.status !== 204) {
|
|
errorPage(res.data.error)
|
|
return
|
|
}
|
|
|
|
clearLocalStorage()
|
|
window.location.href = 'https://ticketsbot.net'
|
|
}
|
|
|
|
process()
|
|
</script> |