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

Problems integrating into leptos-axum project #2

Open
cmdln opened this issue Sep 28, 2024 · 1 comment
Open

Problems integrating into leptos-axum project #2

cmdln opened this issue Sep 28, 2024 · 1 comment

Comments

@cmdln
Copy link

cmdln commented Sep 28, 2024

I added the crate and tried to follow the README. I had to make some changes to the code to get cargo leptos build to work.

thread 'main' panicked at /home/cmdln/.cargo/registry/src/index.crates.io-6f17d22bba15001f/js-sys-0.3.70/src/lib.rs:6035:9:
cannot call wasm-bindgen imported functions on non-wasm targets
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /rustc/6c6d210089e4589afee37271862b9f88ba1d7755/library/std/src/thread/local.rs:260:26:
cannot access a Thread Local Storage value during or after destruction: AccessError
fatal runtime error: thread local panicked on drop

I have a branch in my repo on my own forge that reproduces this error: https://git.cmdln.net/cmdln/watch/src/branch/add-keycloak.

I am using leptos 0.6 with nightly. I tried disabling nightly and still get the error. FWIW, I also tried leptos-oidc with this project and ran into different errors. I am exploring using Keycloak either way so don't mind that your crate has that specific dependency.

@cmdln cmdln changed the title wasm-bindgen errors with cargo leptos watch Problems integrating into leptos-axum project Sep 29, 2024
@cmdln
Copy link
Author

cmdln commented Sep 29, 2024

I resolved this problem with cargo add leptos-use then adding lepto-use to the hydrate feature in my project.

I now can get login to work. After login, the redirect has the session state parameter making me wonder if I am missing something in my config. If I reload the page, the app acts as if I am not authenticated and the sign in url used in my unauthenticated fallback reverts to being empty.

I see you wrote an axum crate as well, I am going to try adding that since it seems like it could handle the missing piece, processing the redirect for the oidc callback.

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

1 participant