fixed login flow inconsistency

This commit is contained in:
ari melody 2024-07-02 20:21:34 +01:00
parent 998e8f2517
commit abab0df83f
Signed by: ari
GPG key ID: CF99829C92678188
10 changed files with 65 additions and 45 deletions

View file

@ -2,7 +2,7 @@ import { Instance, server_types } from './instance.js';
import * as api from './api.js';
import { get, writable } from 'svelte/store';
import { last_read_notif_id } from '$lib/notifications.js';
import { user } from '$lib/stores/user.js';
import { user, logged_in } from '$lib/stores/user.js';
export const client = writable(false);
@ -206,6 +206,7 @@ export class Client {
console.warn("Failed to log out correctly; ditching the old tokens anyways.");
}
localStorage.removeItem(save_name);
logged_in.set(false);
client.set(new Client());
console.log("Logged out successfully.");
}