Created
May 11, 2015 12:57
-
-
Save timurvafin/816dd58467cbc955feec to your computer and use it in GitHub Desktop.
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 ApplicationController < ActionController::Base | |
include Authentication | |
include Authorization | |
protect_from_forgery | |
responders :flash | |
decent_configuration do | |
strategy DecentExposure::StrongParametersStrategy | |
end | |
end |
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
module Authentication | |
extend ActiveSupport::Concern | |
included do | |
helper do | |
def current_user | |
UserPresenter.new(warden.authenticate(scope: :user)) | |
end | |
end | |
end | |
private | |
def devise_parameter_sanitizer | |
if resource_class == User | |
User::ParameterSanitizer.new(User, :user, params) | |
else | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment