Last active
September 5, 2019 19:50
-
-
Save peiyush13/5735af03b46b34875768a6e266a9f5b5 to your computer and use it in GitHub Desktop.
Using RSA encryptor for Api cycle (eg. Sessions Controller)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::SessionsController < Devise::SessionsController | |
include SessionsHelper | |
before_filter :generate_rsa_key, only: [:new] | |
prepend_before_filter -> { authenticate_encryptor([:password]) }, only: [:create] | |
def create | |
# your own code | |
super | |
end | |
def new | |
# your own code | |
super | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment