Skip to content

[5.x]: No longer able to log in to control panel when using custom baseCpUrl #14547

@bfopma

Description

@bfopma

What happened?

Description

We use a separate subdomain for access to the control panel that differs from @web. It looks like changes introduced in this commit have changed the way that actionUrl is generated, and result in a CORS error when the login form is submitted (POSTing to a different URL than the CP uses).

Specifically, setting the $useRequestHostInfo value to true ends up setting the $baseUrl to use @web, whereas it was previously using the value of static:baseCpUrl().

Steps to reproduce

  1. Configure a baseCpUrl that differs from the front end site URL.
  2. Attempt to log in to the CP

Expected behavior

Successful login

Actual behavior

CORS error since the domain for the actionUrl doesn't match the CP's domain

Craft CMS version

5.0.0-beta.6

PHP version

No response

Operating system and version

No response

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions