Skip to content
Open
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
12 changes: 10 additions & 2 deletions ui/src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,17 @@ const user = {
}).catch(() => {
resolve()
}).finally(() => {
const paths = ['/', '/client']
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

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

Suggested change
const paths = ['/', '/client']
const paths = COOKIE_PATHS

Copilot uses AI. Check for mistakes.

const hostname = window.location.hostname
const domains = [undefined, hostname, `.${hostname}`]
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

[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].

Suggested change
const domains = [undefined, hostname, `.${hostname}`]
const dotHostname = `.${hostname}`
const domains = [undefined, hostname, dotHostname]

Copilot uses AI. Check for mistakes.

Object.keys(Cookies.get()).forEach(cookieName => {
Cookies.remove(cookieName)
Cookies.remove(cookieName, { path: '/client' })
paths.forEach(path => {
domains.forEach(domain => {
const options = { path }
if (domain) options.domain = domain
Cookies.remove(cookieName, options)
})
})
})
})
})
Expand Down