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

Question about Wasm with bearer_auth header #2520

Open
f-saez opened this issue Jan 8, 2025 · 0 comments
Open

Question about Wasm with bearer_auth header #2520

f-saez opened this issue Jan 8, 2025 · 0 comments

Comments

@f-saez
Copy link

f-saez commented Jan 8, 2025

Hi,

I've got a little trouble using bearer_auth with wasm.

let me explain.

I've set-up a small server with two simple functions that send back a small JSON. The first function accessible without any authentification send back a JWT, the second one needs a JWT.

When I ran some tests from the command line, everything works fine.
The first function gives me a JWT and I'm using it with the second reqwest call using bearer_auth header.

If I do the same thing from a browser, within a Dioxus app, using the same code, the first call without authentification works well, but the second one using bearer_auth always failed with NetworkError when attempting to fetch resource

I think I've missed something, probably simple, but I don't know what.

Fedora 41 / x84_64
rustc 1.83.0 (90b35a623 2024-11-26)
reqwest = { version = "0.12", features = ["json", "brotli"] }

tested on Firefox and Chromium.

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