Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/client-api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ impl SpacetimeCreds {
Err(e) => Err(e),
};
if let Ok(Query(creds)) = Query::<Self>::try_from_uri(&parts.uri) {
// TODO: do we want to have the `?token=` query param just be the jwt, instead of this?
let creds_header: HeaderValue = format!("Basic {}", creds.token)
.try_into()
.map_err(|_| headers::Error::invalid())?;
let creds = <SpacetimeCreds as authorization::Credentials>::decode(&creds_header)
.ok_or_else(headers::Error::invalid)?;
return Ok(Some(creds));
}
res
Expand Down