Method: ElsToken::ClassMethods#get_identity
- Defined in:
- lib/els_token.rb
#get_identity(token, options = {}) ⇒ Object
When used inside a rack environment will attempt to retrieve the user token from the session cookie and return a full identity. This is pretty much a convenience method that chains is_cookie_token_valid? then get_token_identity
129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/els_token.rb', line 129 def get_identity(token, ={}) = .dup.merge() return fake_id() if .has_key?('faker') begin if is_token_valid?(token, ) get_token_identity(token, ) else raise "token is invalid" end rescue Exception => e raise e end end |