diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-19 16:22:42 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-19 16:22:42 -0600 |
| commit | 45937c020872bca92ad7d8209be6eb719ec8dd53 (patch) | |
| tree | 4cbff9aff037e4f99c24a1720dd11a9954f301f7 /bin/idp | |
| parent | 8f676777db5a16ff20315def95091cc2100bac56 (diff) | |
feat: check if jwt is still valid
Diffstat (limited to 'bin/idp')
| -rwxr-xr-x | bin/idp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -341,12 +341,17 @@ module Authz iat: now, nbf: now, jti: SecureRandom.uuid, + exp: now + 3600, }.merge(claims) end + def [](claim) + claims.fetch(claim) + end + def active? - # TODO:: check if current time is within valid range - true + now = Time.now.to_i + self[:nbf] <= now && now < self[:exp] end def to_jwt |
