From 4b6163e869b7cda09c329db1bf23ba4b75843082 Mon Sep 17 00:00:00 2001 From: frikky Date: Sat, 12 Nov 2022 20:28:23 +0100 Subject: [PATCH] Conditional useEffect in oauth2 mapper fixed --- frontend/src/components/Oauth2Auth.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Oauth2Auth.jsx b/frontend/src/components/Oauth2Auth.jsx index 8a88cead..fcb03f23 100644 --- a/frontend/src/components/Oauth2Auth.jsx +++ b/frontend/src/components/Oauth2Auth.jsx @@ -128,6 +128,13 @@ const AuthenticationOauth2 = (props) => { active: true, }); + useEffect(() => { + console.log("Should automatically click the auto-auth button?") + if (autoAuth === true && selectedApp !== undefined) { + startOauth2Request() + } + }, []) + if (selectedApp.authentication === undefined) { return null; } @@ -216,12 +223,6 @@ const AuthenticationOauth2 = (props) => { } } - useEffect(() => { - console.log("Should automatically click the auto-auth button?") - if (autoAuth === true && selectedApp !== undefined) { - startOauth2Request() - } - }, []) const handleOauth2Request = (client_id, client_secret, oauth_url, scopes, admin_consent) => { setButtonClicked(true);