Skip to content

Commit

Permalink
Use env vars for production
Browse files Browse the repository at this point in the history
  • Loading branch information
juafrlo committed Oct 11, 2011
1 parent a091cf3 commit f219c6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/sessions_controller.rb
@@ -1,6 +1,7 @@
class SessionsController < ApplicationController
def create
if params[:password] == RAILS_ENV == 'production' ? ENV['ADMIN_PASS'] : APP_CONFIG['password']
if (RAILS_ENV != 'production' && params[:password] == APP_CONFIG['password']) ||
(RAILS_ENV == 'production' && params[:password] == ENV['ADMIN_PASS'])
flash[:notice] = t("controllers.sessions.successfully_logged_in")
session[:admin] = true
redirect_to home_url
Expand Down

0 comments on commit f219c6c

Please sign in to comment.