app/controllers/auth.rb
def save_user_id_to_session(user)
      unless user.locked
        session['user_id'] = user.id
        session['admin'] = user.admin ? 'yes' : 'no'
        redirect to '/', 200
      end
      flash['alert-danger'] = 'Account is locked, please click \'Forgot my password\' to unlock'
      session.delete('user_id')
      redirect to '/pre_auth/login', 403
    end
# Save user to session if not locked
Save user to session if not locked
Save user to session if not locked
def save_user_id_to_session(user)
      unless user.locked
        session['user_id'] = user.id
        session['admin'] = user.admin ? 'yes' : 'no'
        redirect to '/', 200
      end
      flash['alert-danger'] = 'Account is locked, please click \'Forgot my password\' to unlock'
      session.delete('user_id')
      redirect to '/pre_auth/login', 403
    end
def save_user_id_to_session ( user ) unless user . locked session [ 'user_id' ] = user . id session [ 'admin' ] = user . admin ? 'yes' : 'no' redirect to '/' , 200 end flash [ 'alert-danger' ] = 'Account is locked, please click \'Forgot my password\' to unlock' session . delete ( 'user_id' ) redirect to '/pre_auth/login' , 403 end
Save user to session if not locked
Save user to session if not locked
user