mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-30 05:48:50 +01:00
when CAS is switched app functions as normal but does not use any other auth methods.
This commit is contained in:
parent
00d06b7a00
commit
f259924a85
5 changed files with 31 additions and 17 deletions
|
|
@ -66,6 +66,11 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
user = User.new(params['user'])
|
||||
|
||||
if Tracks::Config.auth_schemes.include?('cas')
|
||||
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
|
||||
end
|
||||
|
||||
unless user.valid?
|
||||
session['new_user'] = user
|
||||
redirect_to :action => 'new'
|
||||
|
|
@ -74,11 +79,9 @@ class UsersController < ApplicationController
|
|||
|
||||
first_user_signing_up = User.no_users_yet?
|
||||
user.is_admin = true if first_user_signing_up
|
||||
|
||||
if Tracks::Config.auth_schemes.include?('cas')
|
||||
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
|
||||
end
|
||||
|
||||
if user.save
|
||||
@user = User.authenticate(user.login, params['user']['password'])
|
||||
@user.create_preference
|
||||
|
|
@ -99,6 +102,9 @@ class UsersController < ApplicationController
|
|||
return
|
||||
end
|
||||
user = User.new(params[:request])
|
||||
if Tracks::Config.auth_schemes.include?('cas')
|
||||
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
|
||||
end
|
||||
user.password_confirmation = params[:request][:password]
|
||||
if user.save
|
||||
render :text => "User created.", :status => 200
|
||||
|
|
@ -208,4 +214,4 @@ class UsersController < ApplicationController
|
|||
return true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue