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


##########
ui/src/store/modules/user.js:
##########
@@ -472,9 +472,17 @@ const user = {
         }).catch(() => {
           resolve()
         }).finally(() => {
+          const paths = ['/', '/client']
+          const hostname = window.location.hostname
+          const domains = [undefined, hostname, `.${hostname}`]

Review Comment:
   [nitpick] The domains array construction could be simplified and made more 
readable by extracting the dot-prefixed hostname to a separate variable, e.g., 
`const dotHostname = '.${hostname}'` and then using `[undefined, hostname, 
dotHostname]`.
   ```suggestion
             const dotHostname = `.${hostname}`
             const domains = [undefined, hostname, dotHostname]
   ```



##########
ui/src/store/modules/user.js:
##########
@@ -472,9 +472,17 @@ const user = {
         }).catch(() => {
           resolve()
         }).finally(() => {
+          const paths = ['/', '/client']

Review Comment:
   [nitpick] Consider extracting the hardcoded paths array to a configuration 
constant or module-level variable to improve maintainability and make it easier 
to modify these paths in the future.
   ```suggestion
             const paths = COOKIE_PATHS
   ```



-- 
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