fix mitigate authentication verification

users
Miroito 2 years ago
parent 792b0d96ce
commit 30de1a9b53

@ -16,6 +16,10 @@ fn user_icon<G: Html>(cx: Scope, _props: ()) -> View<G> {
#[cfg(client)] #[cfg(client)]
spawn_local_scoped(cx, async move { spawn_local_scoped(cx, async move {
// Since logged in is set to false by default (on the first page load) we have to check
if *global_state.logged_in.get() {
return;
}
let status = api_scope_ref.is_authenticated().await.unwrap().status(); let status = api_scope_ref.is_authenticated().await.unwrap().status();
if status == 200 { if status == 200 {
global_state.logged_in.set(true); global_state.logged_in.set(true);

Loading…
Cancel
Save