mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
fix: Issue with request blocking occuring on login
This commit is contained in:
parent
45737f24e4
commit
d7cea46427
@ -27,9 +27,12 @@ pub fn LoginForm<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View
|
|||||||
input(type="text", id="username", bind:value=username)
|
input(type="text", id="username", bind:value=username)
|
||||||
label(for="password") { "Password" }
|
label(for="password") { "Password" }
|
||||||
input(type="password", bind:value=password)
|
input(type="password", bind:value=password)
|
||||||
button(on:click=move |_| {
|
button(on:click=move |evt: web_sys::Event| {
|
||||||
info!("Attempting login request");
|
info!("Attempting login request");
|
||||||
let (username, password) = ((*username.get_untracked()).clone(), (*password.get_untracked()).clone());
|
let (username, password) = ((*username.get_untracked()).clone(), (*password.get_untracked()).clone());
|
||||||
|
// NOTE(jwall): This is required if we want to keep the below auth request from
|
||||||
|
// failing to send with blocked by browser.
|
||||||
|
evt.prevent_default();
|
||||||
if username != "" && password != "" {
|
if username != "" && password != "" {
|
||||||
spawn_local_scoped(cx, async move {
|
spawn_local_scoped(cx, async move {
|
||||||
let store = crate::api::HttpStore::get_from_context(cx);
|
let store = crate::api::HttpStore::get_from_context(cx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user