mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Fix exception on missing user
This commit is contained in:
parent
3b616698a6
commit
3dc2de0fd6
1 changed files with 2 additions and 1 deletions
|
@ -9,12 +9,13 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
# Omniauth has its own CSRF
|
# Omniauth has its own CSRF
|
||||||
protect_from_forgery :except => [:callback]
|
protect_from_forgery :except => [:callback]
|
||||||
|
|
||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
|
|
||||||
def cuser
|
def cuser
|
||||||
begin
|
begin
|
||||||
@cuser ||= User.find(session[:user])
|
@cuser ||= User.find(session[:user])
|
||||||
|
# Don't error if the user is missing.
|
||||||
rescue
|
rescue
|
||||||
session[:user] = nil
|
session[:user] = nil
|
||||||
@cuser = nil
|
@cuser = nil
|
||||||
|
|
Loading…
Reference in a new issue