Skip to content

Commit

Permalink
fix: display provider oidc info properly
Browse files Browse the repository at this point in the history
  • Loading branch information
PThorpe92 committed Oct 3, 2024
1 parent ca287b8 commit 9d28331
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions backend/src/database/provider_platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ func (db *DB) GetProviderPlatformByID(id int) (*models.ProviderPlatform, error)
Find(&platform, "id = ?", id).Error; err != nil {
return nil, newNotFoundDBError(err, "provider_platforms")
}
key, err := platform.DecryptAccessKey()
if err == nil {
if key, err := platform.DecryptAccessKey(); err == nil {
platform.AccessKey = key
} else {
platform.AccessKey = "error, please update key"
}
if platform.OidcClient != nil {
platform.OidcID = platform.OidcClient.ID
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/Pages/ProviderPlatformManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,18 @@ export default function ProviderPlatformManagement() {
) => {
openOidcClientModal.current?.close();
setEditProvider(undefined);
if (!response && state == ToastState.success) {
if (!response && state === ToastState.success) {
setToast({
state: state,
message: 'OIDC client registered successfully.'
});
} else if (!response && state == ToastState.error) {
} else if (!response && state === ToastState.error) {
setToast({
state: state,
message: 'Failed to register OIDC client.'
});
} else {
console.log(response.data[0]);
setOidcClient(response.data[0] as OidcClient);
setOidcClient(response.data as OidcClient);
openOidcRegistrationModal.current?.showModal();
}
mutate();
Expand Down

0 comments on commit 9d28331

Please sign in to comment.