6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/concerto_cas_auth/omniauth_callback_controller.rb', line 6
def cas_auth
cas_hash = request.env["omniauth.auth"]
user = find_from_omniauth(cas_hash)
if !user
redirect_to "/"
elsif user.persisted?
flash.notice = "Signed in through CAS"
session["devise.user_attributes"] = user.attributes
sign_in user
redirect_to "/"
else
flash.notice = "Signed in through CAS"
session["devise.user_attributes"] = user.attributes
sign_in user
redirect_to "/"
end
end
|