1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Centralize auth (#598)

This commit is contained in:
Zach Gollwitzer 2024-04-03 10:35:55 -04:00 committed by GitHub
parent b3c48d13e7
commit 0a0289846e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 13 additions and 14 deletions

View file

@ -2,7 +2,13 @@ module Authentication
extend ActiveSupport::Concern
included do
helper_method :user_signed_in?
before_action :authenticate_user!
end
class_methods do
def skip_authentication(**options)
skip_before_action :authenticate_user!, **options
end
end
private
@ -15,10 +21,6 @@ module Authentication
end
end
def user_signed_in?
Current.user.present?
end
def login(user)
Current.user = user
reset_session