Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using leptos_actix::redirect in a server function with JS disabled in Firefox or Chromium results in an empty response #2506

Closed
jim-taylor-business opened this issue Apr 8, 2024 · 2 comments

Comments

@jim-taylor-business
Copy link

jim-taylor-business commented Apr 8, 2024

Using leptos_actix::redirect in a server function with JS disabled in Firefox or Chromium results in an empty response.

Leptos Dependencies

From standard cargo leptos new template

use leptos::*;
use leptos_router::*;

#[server(LoginFn, "/serverfn")]
pub async fn login() -> Result<(), ServerFnError> {
    use leptos_actix::redirect;
    redirect("/?some=thing");
    Ok(())
}

#[component]
pub fn App() -> impl IntoView {
    let login = create_server_action::<LoginFn>();
    view! {
        <ActionForm action=login>
            <button type="submit">
                "Login"
            </button>
        </ActionForm>
    }
}

To Reproduce

  1. Disable JS in Firefox or Chromium
  2. Go to /
  3. Click on Login
  4. See blank screen

Expected behavior
Browser should be redirected to /?some=thing.

Screenshots
image

Additional context
This has worked in most previous versions of Leptos.

@gbj
Copy link
Collaborator

gbj commented Apr 8, 2024

Thanks! See the comment in #2507 for an explanation. I tested Axum and it seems like this bug doesn't exist in that integration.

(This has probably been broken since 0.6.0)

@jim-taylor-business
Copy link
Author

(This has probably been broken since 0.6.0)

yep, although i thought it got fixed around 0.6.7 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants