-
Notifications
You must be signed in to change notification settings - Fork 9
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
Sign up with email and password #14
Comments
I haven't been able to reproduce this yet, but I will keep this open and poke at it some more. Typically, that error happens if Supabase is sending a response that can't be parsed into the corresponding struct. My first thought is that there may be some setting in your supabase dashboard that changes the shape of the response. This is the test running in CI (passes): #[tokio::test]
async fn sign_up_with_email_test_valid() {
let auth_client = create_test_client();
let uuid = uuid::Uuid::now_v7();
let demo_email = format!("signup__{}@demo.com", uuid);
let demo_password = "ciJUAojfZZYKfCxkiUWH";
let data = serde_json::json!({
"test": format!("test" ),
"name": format!("test" )
});
let options = SignUpWithPasswordOptions {
data: Some(data),
..Default::default()
};
let session = auth_client
.sign_up_with_email_and_password(demo_email.as_ref(), demo_password, Some(options))
.await
.unwrap();
// Wait to prevent running into Supabase rate limits when running cargo test
let one_minute = time::Duration::from_secs(60);
thread::sleep(one_minute);
assert!(session.user.email == demo_email);
assert!(session.user.user_metadata.name.unwrap() == "test");
assert!(
session
.user
.user_metadata
.custom
.get("test")
.unwrap()
.as_str()
.unwrap()
== "test"
)
} |
If your supabase instance is set up to send confirmation emails on sign up, the /signup endpoint doesn't return a session. It returns a json that looks something like like this
It looks like the javascript client handles this by returning either a session or null, so one solution would be to return None if the confirmation email was sent. |
Thanks for your help! I'll close this issue to keep repository clean |
You sure you don't want to wait until the issue is fixed? |
hmm, mb you are right.. |
Bug report
Describe the bug
Calling function
sign_up_with_email_and_password
always returns an errortracing::error!("Error details: {:?}", e)
will show something like thatError details: AuthError { status: 200, message: "{\"id\":\"ebae4bf5-e...\",\"aud\":\"authenticated\",\"role\":\"authenticated\",\"...}" }
But the user is created successfuly in supabase and receives a confirmation email
It also seems that this function returns not a Session
Thanks!
The text was updated successfully, but these errors were encountered: