Method: Auth#validate_token
- Defined in:
- lib/auth.rb
#validate_token(token, scopes = nil) ⇒ Object
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/auth.rb', line 191 def validate_token(token, scopes = nil) account_id = redis.get("token:#{token}:account") if account_id && decode_scopes(scopes).all? {|scope| redis.sismember("token:#{token}:scopes", scope) } return account_id else return false end end |