projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.clinicalfuture.com:arvados into 1637-improve-arv-tutorial
[arvados.git]
/
services
/
api
/
app
/
controllers
/
user_sessions_controller.rb
diff --git
a/services/api/app/controllers/user_sessions_controller.rb
b/services/api/app/controllers/user_sessions_controller.rb
index 45edc9049bf8dff321a6b483b1ce63fb40e79767..eaaf7b5b93598a0d8a173998e7867ff67933a570 100644
(file)
--- a/
services/api/app/controllers/user_sessions_controller.rb
+++ b/
services/api/app/controllers/user_sessions_controller.rb
@@
-93,20
+93,22
@@
class UserSessionsController < ApplicationController
# Stub: automatically register all new API clients
api_client_url_prefix = callback_url.match(%r{^.*?://[^/]+})[0] + '/'
# Stub: automatically register all new API clients
api_client_url_prefix = callback_url.match(%r{^.*?://[^/]+})[0] + '/'
- api_client = ApiClient.find_or_create_by_url_prefix(api_client_url_prefix)
+ act_as_system_user do
+ @api_client = ApiClient.find_or_create_by_url_prefix api_client_url_prefix
+ end
api_client_auth = ApiClientAuthorization.
new(user: user,
api_client_auth = ApiClientAuthorization.
new(user: user,
- api_client: api_client,
+ api_client:
@
api_client,
created_by_ip_address: remote_ip)
api_client_auth.save!
if callback_url.index('?')
created_by_ip_address: remote_ip)
api_client_auth.save!
if callback_url.index('?')
- callback_url
<<
'&'
+ callback_url
+=
'&'
else
else
- callback_url
<<
'?'
+ callback_url
+=
'?'
end
end
- callback_url
<< 'api_token=' <<
api_client_auth.api_token
+ callback_url
+= 'api_token=' +
api_client_auth.api_token
redirect_to callback_url
end
end
redirect_to callback_url
end
end