Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Alpine.js/Livewire and Power-Grid Authentication redirect hangup #1245

Closed
unplugged216 opened this issue Oct 26, 2022 · 1 comment · Fixed by #1247
Closed

Alpine.js/Livewire and Power-Grid Authentication redirect hangup #1245

unplugged216 opened this issue Oct 26, 2022 · 1 comment · Fixed by #1247

Comments

@unplugged216
Copy link
Contributor

For bug reporting only! If you're posting a feature request or discussion, please ignore.

Expected Behavior

When making a a request via Livewire, after adding the auth header, we expect the requested resource to load.

Current Behavior

When queries are fired, the appropriate header is added. However, the middleware "verify.shopify" is forcing a redirect through responding with HTML and trying to redirect from javascript. This cause the request to end and errors abound.

This does not work...

Steps to Reproduce

  1. Use livewire
@unplugged216
Copy link
Contributor Author

I believe I solved my own problem.... Yay! I added the following to token_handler.blade.php

        if (window.Livewire) {
            // livewire
            window.livewire.addHeaders({
                'Authorization': bearer,
                'content-type': 'application/json',
                'X-Requested-With': 'XMLHttpRequest'
            });
        }

Since this package doesn't recognize Liveware, which is identified in the request, we need to add a little finesse to it. This should work for anyone using livewire combined with this package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant