fix session controller's i18n

This commit is contained in:
yafeilee 2015-04-08 01:08:31 +08:00
parent ff24c47af0
commit e3e611857d
1 changed files with 4 additions and 4 deletions

View File

@ -6,13 +6,13 @@ class Admin::SessionsController < ApplicationController
def create
if ENV['ADMIN_USER'].blank?
render :json=> { success: false, message: t('session.no_configuration') }
render :json=> { success: false, message: t('admin.session.no_configuration') }
elsif ENV['ADMIN_USER'] != params[:username]
render :json=> { success: false, message: t('session.username_error') }
render :json=> { success: false, message: t('admin.session.username_error') }
elsif ENV['ADMIN_PASSWORD'] != params[:password]
render :json=> { success: false, message: t('session.password_error') }
render :json=> { success: false, message: t('admin.session.password_error') }
else
flash[:notice] = t('session.login_success')
flash[:notice] = t('admin.session.login_success')
session[:login] = true
render :json=> { success: true }
end