Skip to content

Commit

Permalink
fix response type
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-sawlani-yral committed Jan 31, 2025
1 parent 7016dd4 commit ff5f24e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ssr/src/page/google_redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@ async fn preview_handle_oauth_query(
.send()
.await?;

let response_text = response.text().await?;

Err(ServerFnError::new(response_text))
if response.status().is_success() {
let identity_wire: DelegatedIdentityWire = response.json().await?;
Ok(identity_wire)
} else {
let err: ServerFnError = response.json().await?;
Err(err)
}
}

#[server]
Expand Down

0 comments on commit ff5f24e

Please sign in to comment.