Skip to content

fix(core): prevent double-submit on login flow grant page - #62357

Open
okxint wants to merge 1 commit into
nextcloud:masterfrom
okxint:fix/login-flow-grant-double-submit
Open

fix(core): prevent double-submit on login flow grant page#62357
okxint wants to merge 1 commit into
nextcloud:masterfrom
okxint:fix/login-flow-grant-double-submit

Conversation

@okxint

@okxint okxint commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #62327

The Vue rewrite of LoginFlowGrant dropped the disable-on-submit guard that existed in the old grant.js (added in #33164). Without it, Chrome's double-fire behavior or a fast second click sends two POST requests before the first response arrives, which can result in duplicate grant confirmations.

Fix: add an isSubmitting ref that blocks re-entry into onSubmit and disables the button while the request is in flight. A NcLoadingIcon is shown in the #icon slot during submission, following the same pattern used in PublicPageMenuExternalDialog.vue.

<!-- before -->
<NcButton type="submit" variant="primary">
    {{ t('core', 'Grant access') }}
</NcButton>

<!-- after -->
<NcButton :disabled="isSubmitting" type="submit" variant="primary">
    <template v-if="isSubmitting" #icon>
        <NcLoadingIcon />
    </template>
    {{ t('core', 'Grant access') }}
</NcButton>

Add isSubmitting guard to onSubmit so the button is disabled and shows
a loading spinner as soon as the first submit fires. A second click
while the form is in-flight is dropped via event.preventDefault().

Fixes: nextcloud#62327

Assisted-by: ClaudeCode:claude-sonnet-4-6
@okxint
okxint requested a review from a team as a code owner July 21, 2026 07:06
@okxint
okxint requested review from kristian-zendato, nfebe and sorbaugh and removed request for a team July 21, 2026 07:06
@CarlSchwan
CarlSchwan requested a review from susnux July 21, 2026 08:29
@CarlSchwan CarlSchwan added bug 3. to review Waiting for reviews community pull requests from community labels Jul 21, 2026
@CarlSchwan CarlSchwan added this to the Nextcloud 35 milestone Jul 21, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@susnux

susnux commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@okxint please fix the linter issues (npm run lint:fix) otherwise this looks good, thank you!

@nextcloud-bot nextcloud-bot mentioned this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug community pull requests from community feedback-requested

Projects

None yet

3 participants