Skip to content

Fix: Prevent access to authenticated routes after logout via back button #246

Closed
@navaneeth0041

Description

🐛 Describe the bug

After clicking logout in the settings menu, the user is redirected to the login screen. However, pressing the back button allows users to return to the authenticated sections of the app, which is a security issue.

Sample code to reproduce the problem:

CustomButtonBar(
  image: Assets.icons.icLogout.path,
  text: "Log Out",
  onTap: () {
    // Current implementation allows returning to authenticated screens
    context.push('/login');
  },
),
WhatsApp.Video.2025-01-28.at.17.56.09.mp4

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions