Skip to content

Instantly share code, notes, and snippets.

@peiyush13
Last active September 5, 2019 19:50
Show Gist options
  • Save peiyush13/5735af03b46b34875768a6e266a9f5b5 to your computer and use it in GitHub Desktop.
Save peiyush13/5735af03b46b34875768a6e266a9f5b5 to your computer and use it in GitHub Desktop.
Using RSA encryptor for Api cycle (eg. Sessions Controller)
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