Merge branch 'dev' of ssh://node.arimelody.me:2082/blisstown/campfire into dev
This commit is contained in:
commit
abb06a40bc
|
@ -1,5 +1,8 @@
|
|||
<script>
|
||||
import * as api from '$lib/api.js';
|
||||
import { account, logged_in } from '$lib/stores/account.js';
|
||||
import { server } from '$lib/client/server.js';
|
||||
import { app } from '$lib/client/app.js';
|
||||
import { play_sound } from '$lib/sound.js';
|
||||
import { getTimeline } from '$lib/timeline.js';
|
||||
import { getNotifications } from '$lib/notifications.js';
|
||||
|
@ -59,7 +62,22 @@
|
|||
|
||||
async function log_out() {
|
||||
if (!confirm("This will log you out. Are you sure?")) return;
|
||||
await get(client).logout();
|
||||
|
||||
const res = await api.revokeToken(
|
||||
get(server).host,
|
||||
get(app).id,
|
||||
get(app).secret,
|
||||
get(app).token
|
||||
);
|
||||
|
||||
if (!res.ok)
|
||||
console.warn("Token revocation failed! Dumping data anyways");
|
||||
|
||||
logged_in.set(false);
|
||||
account.set(false);
|
||||
app.set(false);
|
||||
server.set(false);
|
||||
|
||||
goto("/");
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue