Additional checks for validity and in validator
* Properly check nbf and exp claims in token to determine simple validity. * Properly check nbf and exp claims in validator and throw exceptions if expired/not yet valid.
This commit is contained in:
@ -70,6 +70,14 @@ class JWTToken
|
||||
$this->valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->header->has('nbf')) {
|
||||
$nbf = intval($this->header->get('nbf'));
|
||||
if ($nbf >= time()) {
|
||||
// Invalid if before
|
||||
$this->valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user