Fixed Oauth2 app auth problems

This commit is contained in:
Frikky
2023-11-15 13:32:24 +01:00
parent 9e1195caf2
commit 06593a2ef3
3 changed files with 49 additions and 58 deletions
+9 -20
View File
@@ -125,7 +125,7 @@ const AuthenticationOauth2 = (props) => {
const allscopes = authenticationType.scope !== undefined ? authenticationType.scope : [];
const [selectedScopes, setSelectedScopes] = React.useState(allscopes.length <= 3 ? allscopes : [])
const [selectedScopes, setSelectedScopes] = React.useState(allscopes.length > 0 && allscopes.length <= 3 ? [allscopes[0]] : [])
const [manuallyConfigure, setManuallyConfigure] = React.useState(
defaultConfigSet ? false : true
);
@@ -319,25 +319,6 @@ const AuthenticationOauth2 = (props) => {
"value": authenticationType.token_uri,
}]
// Not necessary yet to do something like this due to not showing the fields anyway
/*
if (selectedApp.parameters !== undefined && selectedApp.parameters !== null && selectedApp.parameters.length > 0) {
for (var i = 0; i < selectedApp.parameters.length; i++) {
if (selectedApp.parameters[i].configuration !== true) {
continue
}
console.log("Found configuration field: ", selectedApp.parameters[i].key, " with example: ", selectedApp.parameters[i].example)
parsedFields.push({
"key": selectedApp.parameters[i].key,
"value": selectedApp.parameters[i].example,
})
}
}
*/
const appAuthData = {
"label": "OAuth2 for " + selectedApp.name,
"app": {
@@ -350,7 +331,15 @@ const AuthenticationOauth2 = (props) => {
"type": "oauth2-app",
"reference_workflow": workflowId,
}
setNewAppAuth(appAuthData)
// Wait 1 second, then get app auth with update
//
if (getAppAuthentication !== undefined) {
setTimeout(() => {
getAppAuthentication(true, true, true);
}, 1000)
}
return
}
+3 -1
View File
@@ -1713,7 +1713,9 @@ const AngularWorkflow = (defaultprops) => {
})
.then((responseJson) => {
if (!responseJson.success) {
toast("Failed to start: " + responseJson.reason);
//toast("Failed to start: " + responseJson.reason);
toast(responseJson.reason);
//toast.error(responseJson.reason);
setExecutionRunning(false);
setExecutionRequestStarted(false);
stop();