Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Remove display of mod-configuration values. Refs UID-182.
* Include mod-settings permissions for access to tenant-wide values. Refs UID-206.
* Display mod-scheduler's timers. Refs UID-208.
* Password reset process - ensure proper response for missing user credentials. Fixes UID-209.

## [10.0.0](https://github.com/folio-org/ui-developer/tree/v10.0.0) (2025-03-17)
[Full Changelog](https://github.com/folio-org/ui-developer/compare/v9.0.0...v10.0.0)
Expand Down
12 changes: 11 additions & 1 deletion src/settings/Passwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Passwd extends React.Component {
path: 'authn/credentials-existence',
fetch: false,
accumulate: true,
throwErrors: false,
},
});

Expand Down Expand Up @@ -95,7 +96,16 @@ class Passwd extends React.Component {
throw new Error(intl.formatMessage({ id: 'ui-developer.passwd.error.missingUser' }, { username: values.username }));
}
})
.then(() => mutator.isLocalPasswordSet.GET({ params: { userId } }))
.then(async () => {
try {
const response = await mutator.isLocalPasswordSet.GET({ params: { userId } });
return response;
} catch (e) {
return {
credentialsExist: false,
};
}
})
Comment on lines -98 to +108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of mixing a promise chain and async/await, it would be better to convert the whole thing to async/await.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a CSP, I didn't want to make too many changes.

.then(res => {
const credentials = {
username: values.username,
Expand Down