Skip to content

feat(core): add options.logout.confirm for logout confirmation dialog#7405

Open
Amaanghazi22 wants to merge 2 commits intorefinedev:mainfrom
Amaanghazi22:feat/logout-confirmation
Open

feat(core): add options.logout.confirm for logout confirmation dialog#7405
Amaanghazi22 wants to merge 2 commits intorefinedev:mainfrom
Amaanghazi22:feat/logout-confirmation

Conversation

@Amaanghazi22
Copy link
Copy Markdown

@Amaanghazi22 Amaanghazi22 commented Apr 26, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

Related issue: N/A (UX improvement proposal)

What is the current behavior?

Clicking logout in the sider or header immediately logs the user out with no confirmation. Users can accidentally log out while navigating.

What is the new behavior?

A new logout.confirm option can be set in <Refine options={{ logout: { confirm: true } }}>. When enabled, a confirmation dialog is shown before logout executes. Defaults to false — no breaking change.

Notes for reviewers

This is a UX improvement. The option defaults to false so existing behavior is fully preserved.

  • antd sider uses Modal.confirm (consistent with Ant Design patterns)
  • mui sider uses window.confirm (can be upgraded to a MUI dialog if preferred)
  • The example app-crm-minimal demonstrates the feature end-to-end

Happy to add tests, docs, and a changeset if maintainers want to move forward.

Adds a new `logout.confirm` option to Refine options that shows a
confirmation dialog before executing logout. Defaults to false to
preserve existing behavior.

- core: add `logout.confirm` to IRefineOptions type and defaults
- antd: ThemedSider shows Modal.confirm when logout.confirm is true
- mui: ThemedSider shows window.confirm when logout.confirm is true
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 26, 2026

⚠️ No Changeset found

Latest commit: 256b5e0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant