Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Dec 9, 2024
1 parent 64a1eb7 commit 45d446e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions atoma-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ mod test {
let refresh_token = auth.generate_refresh_token(user_id).await.unwrap();
let refresh_token_hash = auth.hash_string(&refresh_token);
let mock_handle = tokio::task::spawn(async move {
let event = receiver.recv_async().await.unwrap();
match event {
AtomaAtomaStateManagerEvent::StoreRefreshToken { .. } => {}
_ => panic!("Unexpected event"),
}
let event = receiver.recv_async().await.unwrap();
match event {
AtomaAtomaStateManagerEvent::IsRefreshTokenValid {
Expand Down Expand Up @@ -394,6 +399,11 @@ mod test {
}
_ => panic!("Unexpected event"),
}
let event = receiver.recv_async().await.unwrap();
match event {
AtomaAtomaStateManagerEvent::StoreRefreshToken { .. } => {}
_ => panic!("Unexpected event"),
}
for _ in 0..2 {
// During the token generation, the refresh token is checked for validity
// 1) when the user logs in
Expand Down

0 comments on commit 45d446e

Please sign in to comment.