Module: Card::Set::Right::Account::Views::Format
- Extended by:
- AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb
Instance Method Summary collapse
-
#new_token(extra_payload) ⇒ Object
-
#token_expiry_sentence ⇒ Object
-
#token_url(trigger, extra_payload = {}) ⇒ Object
-
#view: reset_password_days ⇒ Object
-
#view: reset_password_url ⇒ Object
-
#view: token_days ⇒ Object
-
#view: token_expiry ⇒ Object
-
#view: verify_days ⇒ Object
DEPRECATED.
-
#view: verify_url ⇒ Object
Instance Method Details
#new_token(extra_payload) ⇒ Object
43 44 45 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 43 def new_token extra_payload Auth::Token.encode card.accounted_id, extra_payload end |
#token_expiry_sentence ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 39 def token_expiry_sentence "Link will expire in #{render_token_days} days" end |
#token_url(trigger, extra_payload = {}) ⇒ Object
33 34 35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 33 def token_url trigger, extra_payload={} card_url path(action: :update, card: { trigger: trigger }, token: new_token(extra_payload)) end |
#view: reset_password_days ⇒ Object
31 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 31 view :reset_password_days, :token_days |
#view: reset_password_url ⇒ Object
15 16 17 18 19 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 15 view :reset_password_url, denial: :blank do raise Error::PermissionDenied unless card.password_card.ok? :update token_url :reset_password end |
#view: token_days ⇒ Object
25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 25 view :token_days, denial: :blank do Card.config.token_expiry / 1.day end |
#view: token_expiry ⇒ Object
21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 21 view :token_expiry, denial: :blank do "(#{token_expiry_sentence}" end |
#view: verify_days ⇒ Object
DEPRECATED
30 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 30 view :verify_days, :token_days |
#view: verify_url ⇒ Object
9 10 11 12 13 |
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/views.rb', line 9 view :verify_url, cache: :never, denial: :blank do raise Error::PermissionDenied unless card.ok?(:create) || card.action token_url :verify_and_activate, anonymous: true end |