FEATURE: show a new modal when suspended users try to log in

This commit is contained in:
Neil Lalonde
2016-02-19 12:19:20 -05:00
parent afa4e58efd
commit 97130463d6
2 changed files with 7 additions and 2 deletions

View File

@ -261,8 +261,10 @@ class SessionController < ApplicationController
def failed_to_login(user)
message = user.suspend_reason ? "login.suspended_with_reason" : "login.suspended"
render json: { error: I18n.t(message, { date: I18n.l(user.suspended_till, format: :date_only),
reason: user.suspend_reason}) }
render json: {
error: I18n.t(message, { date: I18n.l(user.suspended_till, format: :date_only), reason: user.suspend_reason}),
reason: 'suspended'
}
end
def login(user)