Merge remote-tracking branch 'origin/master' into gs-master

This commit is contained in:
David Yip
2017-11-16 22:52:37 -06:00
29 changed files with 136 additions and 72 deletions

View File

@@ -104,7 +104,7 @@ class ApplicationController < ActionController::Base
unless uncached_ids.empty?
uncached = klass.where(id: uncached_ids).with_includes.map { |item| [item.id, item] }.to_h
uncached.values.each do |item|
uncached.each_value do |item|
Rails.cache.write(item.cache_key, item)
end
end

View File

@@ -62,7 +62,7 @@ class Auth::SessionsController < Devise::SessionsController
if user_params[:otp_attempt].present? && session[:otp_user_id]
authenticate_with_two_factor_via_otp(user)
elsif user && user.valid_password?(user_params[:password])
elsif user&.valid_password?(user_params[:password])
prompt_for_two_factor(user)
end
end