-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controller methods & railtie #2
Conversation
def current_user | ||
if request.env['prx.auth'] | ||
User.find_by(id: request.env['prx.auth'].user_id) | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this else clause should be redundant
Looks mostly good. First, I don't think we can realistically define a Also, instead of |
@eveadele Looks great to me. @kookster did you have something else in mind for the controller stuff? I don't know that it makes sense to go much further than this (except maybe in the future doing things like automatically querying the |
I made a module for current_user and user_logged_in? methods, and added a railtie to include that module and the rack middleware.