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

Lighthouse requires Laravel's auth layer even when all endpoints are public #1084

Closed
palypster opened this issue Dec 12, 2019 · 2 comments
Closed
Labels
bug An error within Lighthouse

Comments

@palypster
Copy link

Describe the bug

Lightouse ending up with:
"Argument 2 passed to Illuminate\Auth\SessionGuard::__construct() must be an instance of Illuminate\Contracts\Auth\UserProvider, null given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 125",

in case I don't have any auth guard set up (in config/auth.php and I even deleted Laravel's default User model. If this is expected, than it should be written somewhere in the documentation.

Expected behavior/Solution

Lighthouse shouldn't be dependent on Laravel's Auth layer (default guard) until querying authenticated/authorized endpoint.

Steps to reproduce

  1. update config/auth.php to disable default guard
  2. query any Lighthouse endpoint
  3. you see the error

Environment

Lighthouse Version: v4.7.1
Laravel Version: v6.2

@spawnia
Copy link
Collaborator

spawnia commented Dec 12, 2019

I would be happy to see a PR for this. If it can be done in a non-breaking manner, i am all for it. If not, we can queue it for the next major version.

@spawnia spawnia added the bug An error within Lighthouse label Dec 12, 2019
@spawnia
Copy link
Collaborator

spawnia commented Dec 30, 2019

You can create a custom GraphQLContext, see #1105 and remove the dependence on guards.

@spawnia spawnia closed this as completed Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error within Lighthouse
Projects
None yet
Development

No branches or pull requests

2 participants