Skip to content

[5.x]: Sign in as user redirects you to /admin even if no permissions to view cp #15449

@white-lukas

Description

@white-lukas

What happened?

Description

When trying to login as another through the cp, you get redirect to the /admin url even when the user doesn't have permissions to view the CP

Steps to reproduce

  1. login to the CP
  2. go to a user that doesn't have cp permissions
  3. click sign in as
  4. you get directed to craftcms.com/admin
  5. you get an unauthorized error banner

Expected behavior

get redirected to the homepage when the user has no cp permissions

Actual behavior

  1. you get directed to craftcms.com/admin
  2. you get an unauthorized error banner

Craft CMS version

5.2.9

PHP version

8.3

Operating system and version

Ubuntu 24.04

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions