Module: DeviseJwtAuth::Concerns::User
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/devise_jwt_auth/concerns/user.rb
Instance Method Summary collapse
- #build_auth_url(base_url, args) ⇒ Object
- #confirmed? ⇒ Boolean
-
#create_named_token_pair(token_options = {}) ⇒ Object
Returns a hash that you can merge into a json response or in the case of testing, merge it into a testing request.
- #extend_batch_buffer(token, client) ⇒ Object
-
#send_confirmation_notification? ⇒ Boolean
this must be done from the controller so that additional params can be passed on from the client.
- #token_validation_response ⇒ Object
Instance Method Details
#build_auth_url(base_url, args) ⇒ Object
107 108 109 110 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 107 def build_auth_url(base_url, args) args[:uid] = uid DeviseJwtAuth::Url.generate(base_url, args) end |
#confirmed? ⇒ Boolean
117 118 119 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 117 def confirmed? devise_modules.exclude?(:confirmable) || super end |
#create_named_token_pair(token_options = {}) ⇒ Object
Returns a hash that you can merge into a json response or in the case of testing, merge it into a testing request.
97 98 99 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 97 def create_named_token_pair( = {}) { DeviseJwtAuth.access_token_name.to_sym => create_token() } end |
#extend_batch_buffer(token, client) ⇒ Object
112 113 114 115 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 112 def extend_batch_buffer(token, client) tokens[client]['updated_at'] = Time.zone.now update_auth_header(token, client) end |
#send_confirmation_notification? ⇒ Boolean
this must be done from the controller so that additional params can be passed on from the client
103 104 105 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 103 def send_confirmation_notification? false end |
#token_validation_response ⇒ Object
121 122 123 |
# File 'app/models/devise_jwt_auth/concerns/user.rb', line 121 def token_validation_response as_json(except: %i[tokens created_at updated_at]) end |