Skip to content

Commit

Permalink
Password clearing #2204 (#2205)
Browse files Browse the repository at this point in the history
* Password clearing #2204

* ui-tests minor change

---------

Co-authored-by: sgauruseu <[email protected]>
(cherry picked from commit da3f926)
  • Loading branch information
anatol-sialitski committed Jan 9, 2025
1 parent b6fa6c7 commit 1021b10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/lib/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exports.update = function updateUser(params) {
};

exports.updatePwd = function (key, pwd) {
var password = pwd.replace(/\s/g, '');
const password = pwd ? pwd.replace(/\s/g, '') : null;
try {
authLib.changePassword({
userKey: key,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/services/graphql/schema/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = schemaGenerator.createObjectType({
type: graphQl.GraphQLBoolean,
args: {
key: graphQl.nonNull(graphQl.GraphQLString),
password: graphQl.nonNull(graphQl.GraphQLString)
password: graphQl.GraphQLString,
},
resolve: function(env) {
return users.updatePwd(env.args.key, env.args.password);
Expand Down
7 changes: 4 additions & 3 deletions testing/page_objects/browsepanel/new.principal.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ class NewPrincipalDialog extends Page {

async waitForDialogLoaded() {
try {
return await this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout);
await this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout);
await this.pause(500);
} catch (err) {
await this.saveScreenshot('err_principal_dialog_load');
throw new Error("New Principal dialog is not loaded in: " + appConst.mediumTimeout + " ms " + err);
let screenshot = await this.saveScreenshotUniqueName('err_principal_dialog_load');
throw new Error(`New Principal dialog is not loaded screenshot${screenshot}: ` + err);
}
}

Expand Down

0 comments on commit 1021b10

Please sign in to comment.