Web:Client:PortalSettings: fix create and edit oauth client
This commit is contained in:
parent
310f2d5dc5
commit
6956adc231
@ -47,14 +47,16 @@ const ClientForm = ({
|
|||||||
description: "",
|
description: "",
|
||||||
redirectUrl: "",
|
redirectUrl: "",
|
||||||
logoutRedirectUrl: "",
|
logoutRedirectUrl: "",
|
||||||
// allowedOrigins: "",
|
|
||||||
// websiteUrl: "",
|
|
||||||
privacyURL: "",
|
privacyURL: "",
|
||||||
// serviceUrl: "",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const [clientId, setClientId] = React.useState<string>("");
|
const [clientId, setClientId] = React.useState<string>(
|
||||||
const [secret, setSecret] = React.useState<string>("");
|
"23b2ec16-6a10-462b-8084-16be8e105b73"
|
||||||
|
);
|
||||||
|
const [secret, setSecret] = React.useState<string>(
|
||||||
|
"d2c083aa-9a2d-4147-9328-df32b7be0294"
|
||||||
|
);
|
||||||
|
|
||||||
const [scopes, setScopes] = React.useState<ScopeDTO[]>([]);
|
const [scopes, setScopes] = React.useState<ScopeDTO[]>([]);
|
||||||
const [checkedScopes, setCheckedScopes] = React.useState<string[]>([]);
|
const [checkedScopes, setCheckedScopes] = React.useState<string[]>([]);
|
||||||
@ -98,7 +100,7 @@ const ClientForm = ({
|
|||||||
newClient.secret = secret;
|
newClient.secret = secret;
|
||||||
newClient.scopes = [...checkedScopes];
|
newClient.scopes = [...checkedScopes];
|
||||||
|
|
||||||
if (id) {
|
if (!id) {
|
||||||
await saveClient(newClient);
|
await saveClient(newClient);
|
||||||
} else {
|
} else {
|
||||||
await updateClient(clientId, newClient);
|
await updateClient(clientId, newClient);
|
||||||
@ -205,6 +207,7 @@ const ClientForm = ({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
isValid = true;
|
||||||
} else {
|
} else {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user