Class: DeviseOtp::Devise::OtpPersistenceController
- Inherits:
-
DeviseController
- Object
- DeviseController
- DeviseOtp::Devise::OtpPersistenceController
- Includes:
- Devise::Controllers::Helpers
- Defined in:
- app/controllers/devise_otp/devise/otp_persistence_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
makes the current browser persistent.
-
#destroy ⇒ Object
clears persistence for the current browser.
-
#reset ⇒ Object
rehash the persistence secret, thus, making all the persistence cookies invalid.
-
#show ⇒ Object
fallback in case of redirect after authentication.
Instance Method Details
#create ⇒ Object
makes the current browser persistent
19 20 21 22 23 24 25 |
# File 'app/controllers/devise_otp/devise/otp_persistence_controller.rb', line 19 def create if otp_set_trusted_device_for(resource) :success, :successfully_set_persistence end redirect_to otp_token_path_for(resource) end |
#destroy ⇒ Object
clears persistence for the current browser
30 31 32 33 34 35 36 |
# File 'app/controllers/devise_otp/devise/otp_persistence_controller.rb', line 30 def destroy if otp_clear_trusted_device_for(resource) :success, :successfully_cleared_persistence end redirect_to otp_token_path_for(resource) end |
#reset ⇒ Object
rehash the persistence secret, thus, making all the persistence cookies invalid
41 42 43 44 45 46 47 |
# File 'app/controllers/devise_otp/devise/otp_persistence_controller.rb', line 41 def reset if otp_reset_persistence_for(resource) :notice, :successfully_reset_persistence end redirect_to otp_token_path_for(resource) end |
#show ⇒ Object
fallback in case of redirect after authentication
12 13 14 |
# File 'app/controllers/devise_otp/devise/otp_persistence_controller.rb', line 12 def show redirect_to otp_token_path_for(resource) end |