Class: LinkedRails::Auth::Password
- Inherits:
-
Resource
- Object
- Resource
- LinkedRails::Auth::Password
- Defined in:
- app/models/linked_rails/auth/password.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#password ⇒ Object
Returns the value of attribute password.
-
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
-
#reset_password_token ⇒ Object
Returns the value of attribute reset_password_token.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
- .action_list ⇒ Object
- .decrypt_token(token) ⇒ Object
- .form_class ⇒ Object
- .iri_namespace ⇒ Object
- .requested_singular_resource(params, _user_context) ⇒ Object
- .singular_route_key ⇒ Object
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'app/models/linked_rails/auth/password.rb', line 10 def email @email end |
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'app/models/linked_rails/auth/password.rb', line 10 def password @password end |
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
10 11 12 |
# File 'app/models/linked_rails/auth/password.rb', line 10 def password_confirmation @password_confirmation end |
#reset_password_token ⇒ Object
Returns the value of attribute reset_password_token.
10 11 12 |
# File 'app/models/linked_rails/auth/password.rb', line 10 def reset_password_token @reset_password_token end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'app/models/linked_rails/auth/password.rb', line 10 def user @user end |
Class Method Details
.action_list ⇒ Object
14 15 16 |
# File 'app/models/linked_rails/auth/password.rb', line 14 def action_list LinkedRails.password_action_list_class end |
.decrypt_token(token) ⇒ Object
18 19 20 |
# File 'app/models/linked_rails/auth/password.rb', line 18 def decrypt_token(token) Devise.token_generator.digest(self, :reset_password_token, token) end |
.form_class ⇒ Object
22 23 24 |
# File 'app/models/linked_rails/auth/password.rb', line 22 def form_class LinkedRails.password_form_class end |
.iri_namespace ⇒ Object
26 27 28 |
# File 'app/models/linked_rails/auth/password.rb', line 26 def iri_namespace Vocab.ontola end |
.requested_singular_resource(params, _user_context) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/linked_rails/auth/password.rb', line 30 def requested_singular_resource(params, _user_context) reset_password_token = decrypt_token(params[:reset_password_token]) user_by_token ||= LinkedRails.user_class.find_by(reset_password_token: reset_password_token) return new(reset_password_token: params[:reset_password_token]) if user_by_token.blank? new( reset_password_token: params[:reset_password_token], user: user_by_token ) end |
.singular_route_key ⇒ Object
41 42 43 |
# File 'app/models/linked_rails/auth/password.rb', line 41 def singular_route_key 'u/password' end |