Skip to content

Commit

Permalink
no unwrap on existing session ip
Browse files Browse the repository at this point in the history
  • Loading branch information
sebadob committed Oct 11, 2023
1 parent 5fb7af4 commit c5c8837
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rauthy-models/src/entity/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,14 @@ impl Session {
if (self.state == SessionState::Open || self.state == SessionState::Auth)
&& self.remote_ip.as_ref() != Some(&ip)
{
let session_ip = self
.remote_ip
.as_ref()
.map(|ip| ip.as_str())
.unwrap_or("UNKNOWN");
warn!(
"Invalid access for session {} / {} with different IP: {}",
self.id,
self.remote_ip.as_ref().unwrap(),
ip,
self.id, session_ip, ip,
);
return false;
}
Expand Down

0 comments on commit c5c8837

Please sign in to comment.