fix: invalid-credentials code, no refresh on wrong pw
This commit is contained in:
@@ -62,6 +62,7 @@ async fn self_delete_with_a_wrong_password_is_refused_and_keeps_the_account() {
|
||||
)
|
||||
.await;
|
||||
assert_eq!(status, 401, "{body}");
|
||||
assert!(body.contains("\"INVALID_CREDENTIALS\""), "{body}");
|
||||
let (status, _, _) = send(&router, get(&format!("/users/{}", alice.user_id), None)).await;
|
||||
assert_eq!(status, 200);
|
||||
}
|
||||
@@ -109,8 +110,9 @@ async fn an_admin_deletes_another_account() {
|
||||
promote(&pool, &alice.user_id).await;
|
||||
let uri = format!("/api/v1/users/{}", bob.user_id);
|
||||
|
||||
let (status, _, _) = send(&router, delete_json(&uri, &alice.token, "nope")).await;
|
||||
let (status, _, body) = send(&router, delete_json(&uri, &alice.token, "nope")).await;
|
||||
assert_eq!(status, 401, "wrong admin password");
|
||||
assert!(body.contains("\"INVALID_CREDENTIALS\""), "{body}");
|
||||
|
||||
let (status, _, body) = send(&router, delete_json(&uri, &alice.token, PASSWORD)).await;
|
||||
assert_eq!(status, 204, "{body}");
|
||||
|
||||
Reference in New Issue
Block a user