Skip to content

Commit

Permalink
Add blocked state due to account expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Petersson authored and buggmagnet committed Oct 20, 2023
1 parent 52fd2c2 commit eb32396
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ final class TunnelStatusNotificationProvider: NotificationProvider, InAppNotific
errorString = "No servers match your settings, try changing server or other settings."
case .invalidAccount:
errorString = "You are logged in with an invalid account number. Please log out and try another one."
case .accountExpired:
errorString = "Account is out of time."
case .deviceRevoked, .deviceLoggedOut:
errorString = "Unable to authenticate account. Please log out and log back in."
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ extension DeviceCheck {
return .deviceRevoked
}

if case .expired = accountVerdict {
return .accountExpired
}

return nil
}
}
4 changes: 2 additions & 2 deletions ios/PacketTunnelCore/Actor/State+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ extension BlockedStateReason {
case .deviceLocked:
return true

case .noRelaysSatisfyingConstraints, .readSettings, .invalidAccount, .deviceRevoked, .tunnelAdapter, .unknown,
.deviceLoggedOut, .outdatedSchema, .invalidRelayPublicKey:
case .noRelaysSatisfyingConstraints, .readSettings, .invalidAccount, .accountExpired, .deviceRevoked,
.tunnelAdapter, .unknown, .deviceLoggedOut, .outdatedSchema, .invalidRelayPublicKey:
return false
}
}
Expand Down
3 changes: 3 additions & 0 deletions ios/PacketTunnelCore/Actor/State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ public enum BlockedStateReason: String, Codable, Equatable {
/// Invalid account.
case invalidAccount

/// Account is expired.
case accountExpired

/// Device revoked.
case deviceRevoked

Expand Down

0 comments on commit eb32396

Please sign in to comment.