diff --git a/.editorconfig b/.editorconfig index 81ed7f265d..8f0a1b5838 100644 --- a/.editorconfig +++ b/.editorconfig @@ -30,4 +30,7 @@ indent_size = 2 # Matches the exact files either package.json or .travis.yml [{package.json,.travis.yml}] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 + +[*.{ts,tsx}] +indent_style = tab diff --git a/ee/query-service/app/api/auth.go b/ee/query-service/app/api/auth.go index 9a28fce263..b18f8faddc 100644 --- a/ee/query-service/app/api/auth.go +++ b/ee/query-service/app/api/auth.go @@ -50,7 +50,7 @@ func (ah *APIHandler) loginUser(w http.ResponseWriter, r *http.Request) { } // if all looks good, call auth - resp, err := baseauth.Login(ctx, &req) + resp, err := baseauth.Login(ctx, &req, nil) if ah.HandleError(w, err, http.StatusUnauthorized) { return } diff --git a/frontend/src/container/Login/index.tsx b/frontend/src/container/Login/index.tsx index a2a10b184d..022d5aaf71 100644 --- a/frontend/src/container/Login/index.tsx +++ b/frontend/src/container/Login/index.tsx @@ -49,6 +49,7 @@ function Login({ const [precheckInProcess, setPrecheckInProcess] = useState(false); const [precheckComplete, setPrecheckComplete] = useState(false); + const [headerAuthEmail, setHeaderAuthEmail] = useState(null); const { notifications } = useNotifications(); @@ -64,11 +65,14 @@ function Login({ getUserVersionResponse.data && getUserVersionResponse.data.payload ) { - const { setupCompleted } = getUserVersionResponse.data.payload; + const { setupCompleted, headerEmail } = getUserVersionResponse.data.payload; if (!setupCompleted) { // no org account registered yet, re-route user to sign up first history.push(ROUTES.SIGN_UP); } + if (headerEmail) { + setHeaderAuthEmail(headerEmail); + } } }, [getUserVersionResponse]); @@ -186,6 +190,12 @@ function Login({ } }; + useEffect(() => { + form.setFieldValue('email', headerAuthEmail); + setPrecheckComplete(true); + form.submit(); + }, [headerAuthEmail, form]); + const renderSAMLAction = (): JSX.Element => (