Created
July 29, 2016 15:46
-
-
Save craigplummer/b025056d4629bb177bca55a77bd53c6e to your computer and use it in GitHub Desktop.
Using Microsoft Azure AD for API Authentication with Rails and Warden - warden_helper.rb
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 WardenHelper | |
extend ActiveSupport::Concern | |
included do | |
helper_method :warden, :current_user | |
prepend_before_filter :authenticate! | |
end | |
def current_user | |
warden.user | |
end | |
def warden | |
request.env['warden'] | |
end | |
def authenticate! | |
warden.authenticate! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment