googlearchive/firebase-token-generator-ruby

current token is_expired() method?

Closed this issue · 2 comments

How do I check if a current token is expired?

This repo is specifically for the generation of Firebase JWTs. If you decode the token using another library the expiry is easy to find, and then aside from any clock skew between your machine and our servers you should have a pretty good idea if it's valid

Thanks. using https://github.com/progrium/ruby-jwt.

begin
JWT.decode("JWT_STRING", "secret")
rescue JWT::ExpiredSignature
# Signature has expired
end