From 931f77f9bff46dbba8adb0517720eb3c60b83bb3 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 7 May 2018 15:11:58 -0400 Subject: [PATCH] 12626: Copy omniauth info into auth account, not target account. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- .../app/controllers/user_sessions_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb index 87967a40a5..20633153e7 100644 --- a/services/api/app/controllers/user_sessions_controller.rb +++ b/services/api/app/controllers/user_sessions_controller.rb @@ -46,13 +46,6 @@ class UserSessionsController < ApplicationController end end - while (uuid = user.andand.redirect_to_user_uuid) - user = User.where(uuid: uuid).first - if !user - raise Exception.new("identity_url #{omniauth['info']['identity_url']} redirects to nonexistent uuid #{uuid}") - end - end - if not user # New user registration user = User.new(:email => omniauth['info']['email'], @@ -75,6 +68,13 @@ class UserSessionsController < ApplicationController # First login to a pre-activated account user.identity_url = omniauth['info']['identity_url'] end + + while (uuid = user.redirect_to_user_uuid) + user = User.where(uuid: uuid).first + if !user + raise Exception.new("identity_url #{omniauth['info']['identity_url']} redirects to nonexistent uuid #{uuid}") + end + end end # For the benefit of functional and integration tests: -- 2.30.2