Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

cookies[:uid] may be an id that doesn't exist #51

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/thincloud/authentication/authenticatable_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module AuthenticatableController
# Returns: An instance of `User` or `nil`.
def current_user
return nil if cookies.signed[:uid].blank?
@current_user ||= User.find(cookies.signed[:uid])
@current_user ||= User.where(id: cookies.signed[:uid]).first
end

# Protected: Determine if the current request has a logged in user.
Expand Down