This commit is contained in:
@@ -104,10 +104,10 @@ impl Token {
|
||||
|
||||
/// Check whether a token is expired or not
|
||||
pub fn is_expired(&self) -> bool {
|
||||
if let Some(max_inactivity) = self.max_inactivity {
|
||||
if max_inactivity + self.last_used < time() {
|
||||
return true;
|
||||
}
|
||||
if let Some(max_inactivity) = self.max_inactivity
|
||||
&& max_inactivity + self.last_used < time()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
false
|
||||
@@ -188,10 +188,10 @@ impl NewToken {
|
||||
return Some(err);
|
||||
}
|
||||
|
||||
if let Some(t) = self.max_inactivity {
|
||||
if t < 3600 {
|
||||
return Some("API tokens shall be valid for at least 1 hour!");
|
||||
}
|
||||
if let Some(t) = self.max_inactivity
|
||||
&& t < 3600
|
||||
{
|
||||
return Some("API tokens shall be valid for at least 1 hour!");
|
||||
}
|
||||
|
||||
None
|
||||
|
Reference in New Issue
Block a user