You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Statamic as a headless CMS, so I don't need any non-control panel views and it can be hosted on it's own domain. To accomplish this, I set cp.route to an empty string.
This works generally, but it breaks the login screen when an OAuth provider is enabled. The offending line is resources/views/auth/login.blade.php:
@foreach ($providersas$provider)
<divclass="provider mb-2">
<ahref="{{$provider->loginUrl() }}?redirect={{parse_url(cp_route('index'))['path'] }}"class="w-full btn-primary">
{{-- ^----------------------------------^ --}}{{__('Log in with :provider', ['provider'=>$provider->label()]) }}
</a>
</div>
@endforeach
Since the cp_route helper returns the app URL without a trailing slash, the assoc. array from parse_url won't have a path key, causing an error to be thrown. From my limited testing, it can be fixed using:
I also tried setting cp.route to / instead to work around this. It does not fix the issue and seems to cause other issues, particularly with redirects.
OAuth flow initiations immediately redirect back to /auth/login instead of the provider. Similarly, navigating /auth/login or / when already logged in redirects to https://dashboard.
The text was updated successfully, but these errors were encountered:
Bug description
I'm trying to use Statamic as a headless CMS, so I don't need any non-control panel views and it can be hosted on it's own domain. To accomplish this, I set
cp.route
to an empty string.This works generally, but it breaks the login screen when an OAuth provider is enabled. The offending line is
resources/views/auth/login.blade.php
:Since the
cp_route
helper returns the app URL without a trailing slash, the assoc. array fromparse_url
won't have apath
key, causing an error to be thrown. From my limited testing, it can be fixed using:How to reproduce
cp.route
to''
directly or via environment variableLogs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
I also tried setting
cp.route
to/
instead to work around this. It does not fix the issue and seems to cause other issues, particularly with redirects.OAuth flow initiations immediately redirect back to
/auth/login
instead of the provider. Similarly, navigating/auth/login
or/
when already logged in redirects tohttps://dashboard
.The text was updated successfully, but these errors were encountered: