Skip to content

Commit

Permalink
Fix simplelogin auth (#486)
Browse files Browse the repository at this point in the history
## Type of change
```
- [x] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```

## Objective
Simplelogin was using the bearer Authorization header while it was
supposed to use non-standard Authentication
  • Loading branch information
dani-garcia authored Jan 8, 2024
1 parent c45ad21 commit bd592bd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn generate_with_api_url(
let response = http
.post(format!("{api_url}/api/alias/random/new{query}"))
.header(CONTENT_TYPE, "application/json")
.bearer_auth(api_key)
.header("Authentication", api_key)
.json(&Request { note })
.send()
.await?;
Expand Down Expand Up @@ -65,7 +65,7 @@ mod tests {
.and(matchers::method("POST"))
.and(matchers::query_param("hostname", "example.com"))
.and(matchers::header("Content-Type", "application/json"))
.and(matchers::header("Authorization", "Bearer MY_TOKEN"))
.and(matchers::header("Authentication", "MY_TOKEN"))
.and(matchers::body_json(json!({
"note": "Website: example.com. Generated by Bitwarden."
})))
Expand All @@ -78,7 +78,7 @@ mod tests {
.and(matchers::method("POST"))
.and(matchers::query_param("hostname", "example.com"))
.and(matchers::header("Content-Type", "application/json"))
.and(matchers::header("Authorization", "Bearer MY_FAKE_TOKEN"))
.and(matchers::header("Authentication", "MY_FAKE_TOKEN"))
.and(matchers::body_json(json!({
"note": "Website: example.com. Generated by Bitwarden."
})))
Expand Down

0 comments on commit bd592bd

Please sign in to comment.