Closed webrgp closed 5 months ago
You shouldn't actually need to create a CP URL for this endpoint, as there's already an action endpoint for this:
https://my-site.test/actions/consume/auth/callback
The reason we use a Site URL is that it forgoes the need to use an Action URL that might use pathInfo
(query strings) for the action, like https://my-site.test/index.php?q=actions/consume/auth/callback
. This is because a few providers don't allow query strings in the callback URL.
So I've actually changed the Redirect URI to show the Action URL when headlessMode
is enabled, rather than creating the CP URL as per this PR. Appreciate the effort!
To get this early, run composer require verbb/consume:"dev-craft-4 as 1.0.10"
.
Although on second thought, I think it's nicer to define the route as a CP one for a slightly tidier URL, so we'll go with what you have! https://github.com/verbb/consume/commit/f2063a27ecb0d4730a964a30c63fdf47bff5f138
In some headless setups, the primary site url can be pointing to another domain. That breaks the OAuthClient because it tries to redirect to the primary site url.
This adds a
headlessMode
configuration check that allows for the routeconsume/auth/callback
to be available in the control panel.