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

Oauth error #21

Open
Raflos10 opened this issue Jan 30, 2025 · 4 comments
Open

Oauth error #21

Raflos10 opened this issue Jan 30, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@Raflos10
Copy link
Contributor

Bug report

Describe the bug

NetworkError(reqwest::Error { kind: Builder, source: "JsValue(TypeError: Request constructor: HEAD or GET Request cannot have a body.)" })

To Reproduce

self.auth.login_with_oauth(provider, None).await.unwrap();

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

It seems like JS client doesn't call any endpoint, it just navigates the browser to the [project_url]/authorize with the parameters.

@Raflos10 Raflos10 added the bug Something isn't working label Jan 30, 2025
@Proziam
Copy link
Collaborator

Proziam commented Jan 30, 2025

The login_with_oauth method returns the url and provider so that API consumers can decide how and when to implement the redirect.

This is the way it's handled in the official Python library, for example

@Raflos10
Copy link
Contributor Author

The login_with_oauth method returns the url and provider so that API consumers can decide how and when to implement the redirect.

This is the way it's handled in the official Python library, for example

Yes, it's handled that way in the JS client too.
But here it's actually calling /authorize https://github.com/supabase-community/supabase-auth-rs/blob/main/src/client.rs#L552
And that's where you get the error.

@Proziam
Copy link
Collaborator

Proziam commented Jan 31, 2025

Both tests (with and without options) pass in CI, and both return valid redirect URL's, so I'm not sure what is causing the issue. It's also showing no errors in the Supabase dashboard.

I am unable to reproduce this with the demo project at the moment.

@Raflos10
Copy link
Contributor Author

Raflos10 commented Feb 2, 2025

Could you clarify the reason for calling the /authorize endpoint? I can't find any documentation on it and it doesn't seem to be used in the other auth clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants