Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API return #38

Closed
robov opened this issue May 24, 2021 · 1 comment
Closed

API return #38

robov opened this issue May 24, 2021 · 1 comment

Comments

@robov
Copy link

robov commented May 24, 2021

Awesome package, and i really love it.
When an IP is blocked it shows nicely the "blocked" view

However, sometimes I call the backend through axios and then I get the view back in the console. Any suggestions what the best way of communication to the user is with API calls

As far as I can see in the code I cannot change the response based on a api call or a http call

Suggestion
Maybe in the middleware.php determine if the call was an api and then use different config parameters to return
then on a blocked api call the frontend can determine the error and show a message to the user / or redirect with js

@denisdulici
Copy link
Member

Glad to see you like the package 😉

I don't think there is an easy way to find if the request is an API call but feel free to send a PR for any kind of solution.

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

No branches or pull requests

2 participants