Last active
November 15, 2023 20:22
-
-
Save btwelch/427a7048223e4ee782bbd8bb09d10033 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
application_controller.rb | |
... | |
private | |
def authenticate_user! | |
super | |
check_user_active! | |
end | |
def check_user_active! | |
if current_user && !current_user.active? | |
sign_out current_user | |
redirect_to new_user_session_path, alert: "This user account has been inactivated. Please check with your administrator if you feel this is in error." | |
return false | |
else | |
return true | |
end | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment