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

Auth middleware for API #526

Closed
sergeyantonuk opened this issue Jul 12, 2020 · 4 comments
Closed

Auth middleware for API #526

sergeyantonuk opened this issue Jul 12, 2020 · 4 comments
Assignees
Labels
feature Enhancement to the code

Comments

@sergeyantonuk
Copy link

How can I change authentification behavior?
I am developing API where I use osiset package.
I need api to return unauthorized instead HTML form.
Is there a way to do it with this package? Or any recommendations?

As I can see we have: /vendor/osiset/laravel-shopify/src/ShopifyApp/Http/Middleware/AuthShopify.php
where we have private: handleBadVerification() method, where we have redirect to login page: return Redirect::route('login');

In case there is no better ways, I have a backup plan to extend AuthShopify and override handleBadVerification method, but it's private and I can't do that

@gnikyt
Copy link
Owner

gnikyt commented Jul 14, 2020

You're asking if theres an ability to instead of redirection to /login, to go somewhere else?

@gnikyt gnikyt added needs-info More information required invalid Invalid to the repository (not a code issue, etc) labels Jul 14, 2020
@gnikyt gnikyt self-assigned this Jul 14, 2020
@gnikyt gnikyt added type-question and removed invalid Invalid to the repository (not a code issue, etc) labels Jul 14, 2020
@sergeyantonuk
Copy link
Author

I need it for the API, so it has to return 401 Unauthorized status instead redirect to login page

@gnikyt
Copy link
Owner

gnikyt commented Jul 15, 2020

I am in the works of working on a method for this right now as login method is deprecated on Shopify.

I will include this with next update, which will throw an exception which you can catch in Laravel.

@gnikyt gnikyt added feature Enhancement to the code and removed needs-info More information required question labels Jul 15, 2020
@darrynten darrynten mentioned this issue Oct 12, 2020
@darrynten
Copy link
Contributor

@sergeyantonuk can you see if the new JWT support resolves your problem?

@gnikyt gnikyt closed this as completed Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Enhancement to the code
Projects
None yet
Development

No branches or pull requests

3 participants