Module: JWTUserAuth
- Defined in:
- lib/jwt_auth/resource.rb
Instance Method Summary collapse
Instance Method Details
#as_json(options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/jwt_auth/resource.rb', line 7 def as_json(={}) res = super() res['auth_token'] = self.auth_token res end |
#auth_token ⇒ Object
2 3 4 |
# File 'lib/jwt_auth/resource.rb', line 2 def auth_token JsonWebToken.encode(self.id) end |