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)
   = redis.get("token:#{token}:account")
  if  && 
     decode_scopes(scopes).all? {|scope|
       redis.sismember("token:#{token}:scopes", scope) }
    return 
  else
    return false
  end
end