Copilot commented on code in PR #13955:
URL: https://github.com/apache/cloudstack/pull/13955#discussion_r4514202441


##########
api/src/main/java/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java:
##########
@@ -75,8 +77,8 @@ public class CreateAccountCmd extends BaseCmd {
 
     @Parameter(name = ApiConstants.PASSWORD,
                type = CommandType.STRING,
-               required = true,
-               description = "Clear text password (Default hashed to 
SHA256SALT). If you wish to use any other hashing algorithm, you would need to 
write a custom authentication adapter See Docs section.")
+               description = "Clear text password (Default hashed to 
SHA256SALT). If you wish to use any other hashing algorithm, you will need to 
write a custom authentication adapter See Docs section. "

Review Comment:
   There’s an extra trailing space at the end of the first string literal 
(`\"... Docs section. \"`) which will be preserved in generated API docs/help 
text. Remove the trailing space (and consider adjusting punctuation around 
'adapter'/'See Docs section' if desired) to keep documentation clean.



##########
ui/src/views/iam/AddAccount.vue:
##########
@@ -250,6 +256,14 @@ export default {
         }
       },
       immediate: false
+    },
+    'form.samlenable' (samlEnabled) {
+      // a SAML-authenticated account never logs in with a native password
+      this.rules.password = samlEnabled ? [] : [{ required: true, message: 
this.$t('message.error.required.input') }]
+      this.rules.confirmpassword = samlEnabled ? [] : [
+        { required: true, message: this.$t('message.error.required.input') },
+        { validator: this.validateConfirmPassword }
+      ]
     }

Review Comment:
   This watcher updates form validation rules when `form.samlenable` changes, 
but it does not run on initial render. If `form.samlenable` can be `true` 
initially (e.g., prefilled/defaulted), the form may still consider password 
fields required (or keep stale rules) even though the fields are hidden. Make 
the watcher run immediately (or set the initial rules in `created/mounted`) so 
rules always match the initial `samlenable` state.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to