Skip to content

fix(web): [OCISDEV-1187] disable confirm in link password dialog when empty - #13218

Merged
gauravsoni119 merged 1 commit into
masterfrom
fix/OCISDEV-1187-link-password-empty-confirm
Oct 26, 2026
Merged

gauravsoni119 merged 1 commit into
masterfrom
fix/OCISDEV-1187-link-password-empty-confirm

Conversation

@gauravsoni119

@gauravsoni119 gauravsoni119 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

The "Add password" / "Edit password" dialog for links opened with an empty field and an enabled Confirm button. Clicking Confirm, or pressing Enter, without typing removed the password from the link. Confirm now starts disabled, and Enter only confirms when the password policy is fulfilled, same as the Confirm button.

 SetLinkPasswordModal
+  onMounted → update:confirmDisabled(true)
-  keydown.enter → confirm
+  keydown.enter → confirm, only if inputPasswordPolicy.check(password)
   passwordChallengeFailed / Completed → update:confirmDisabled(true / false)   # unchanged, the input's policy check while typing

An empty password is a valid request on the server (used by "Remove password" and internal links), so the fix is in the dialog rather than the API.

Related Issue

  • Fixes OCISDEV-1187

Motivation and Context

The dialog's Confirm state was driven only by the password policy check, which runs when the value changes, so nothing disabled Confirm before the first keystroke.

How Has This Been Tested?

  • test environment: vitest, plus manual check in ocis_full with OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false and OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=false, on a link that has a password
  • before: open "Edit password", click Confirm without typing → "Link was updated successfully", and the link opens without a password prompt; pressing Enter does the same
  • after: Confirm is disabled when the dialog opens, Enter in the empty field or with a value the policy rejects (e.g. a single space) does nothing, typing then clearing disables Confirm again, a generated or valid password still saves, "Remove password" still works; with OCIS_PASSWORD_POLICY_DISABLED=true, " " is accepted by both Confirm and Enter and '' is still blocked
  • test case 1: mounting the dialog emits update:confirmDisabled true (fails without the fix)
  • test case 2: typing and clearing emits no update:confirmDisabled from the dialog itself (left to the input's policy check)
  • test case 3: Enter on an empty field emits no confirm (fails without the fix)
  • test case 4: Enter with " " while the policy is not fulfilled emits no confirm (fails without the fix); with the policy fulfilled it emits confirm

Merge Danger

Door: two-way. Frontend only, no data or API change; reverting restores the old behaviour.

Blast Radius: small. Only SetLinkPasswordModal.vue, used by the link sidebar's Add password, Edit password, and the link-type change that asks for a password first.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@gauravsoni119
gauravsoni119 requested a review from a team as a code owner October 23, 2026 11:34
@kw-security

kw-security commented Oct 23, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gauravsoni119
gauravsoni119 force-pushed the fix/OCISDEV-1187-link-password-empty-confirm branch from 99aecec to f5cf5ae Compare October 23, 2026 11:51
@gauravsoni119
gauravsoni119 requested review from LukasHirt and mzner and removed request for LukasHirt October 23, 2026 12:56
@gauravsoni119
gauravsoni119 force-pushed the fix/OCISDEV-1187-link-password-empty-confirm branch from f5cf5ae to 3bcb0a7 Compare October 26, 2026 08:16
@gauravsoni119
gauravsoni119 force-pushed the fix/OCISDEV-1187-link-password-empty-confirm branch from 3bcb0a7 to 8e17f5a Compare October 26, 2026 10:17
@gauravsoni119
gauravsoni119 requested a review from mzner October 26, 2026 10:18
… empty

The link "Add password" / "Edit password" dialog could be confirmed, by
button or Enter, while the field was still empty, which removed the
password from the link. Confirm now starts disabled, and Enter only
confirms when the password policy is fulfilled, same as the button.

Signed-off-by: Gaurav Soni <sonigaurav119@gmail.com>
@gauravsoni119
gauravsoni119 force-pushed the fix/OCISDEV-1187-link-password-empty-confirm branch from 8e17f5a to d50ad8d Compare October 26, 2026 10:47
@gauravsoni119
gauravsoni119 merged commit efe85ba into master Oct 26, 2026
139 of 142 checks passed
@gauravsoni119
gauravsoni119 deleted the fix/OCISDEV-1187-link-password-empty-confirm branch October 26, 2026 13:24
gauravsoni119 added a commit that referenced this pull request Oct 27, 2026
… empty (#13218)

The link "Add password" / "Edit password" dialog could be confirmed, by
button or Enter, while the field was still empty, which removed the
password from the link. Confirm now starts disabled, and Enter only
confirms when the password policy is fulfilled, same as the button.

Signed-off-by: Gaurav Soni <sonigaurav119@gmail.com>
gauravsoni119 added a commit that referenced this pull request Oct 28, 2026
…ialog when empty (#13234)

fix(web): [OCISDEV-1187] disable confirm in link password dialog when empty (#13218)

The link "Add password" / "Edit password" dialog could be confirmed, by
button or Enter, while the field was still empty, which removed the
password from the link. Confirm now starts disabled, and Enter only
confirms when the password policy is fulfilled, same as the button.

Signed-off-by: Gaurav Soni <sonigaurav119@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants