Closed a-zog closed 4 years ago
Is web your default guard?
API is set to be the default
yeah, that may be the problem, We actually never set the default to api so maybe that is why I never encounter this error. We have 2 options here.
guard(with: ['api'])
(this is what we usually do)Auth::guard('web')->onceUsingId($user->id)
This is done just because we need to set the logged in user to retreive it later in the pipeline. I still want to see a better way to do this but for now these would be the options.
Okey, thank you for your help
no problem, closing this.
I have the same problem.
How to fix this bug?
Thanks! @joselfonseca
Hi @rushairer is not actually a bug, but in the latest version I changed that to use another method to set the user. you can update to latest keeping in mind there is a breaking change in how social login works, or override the method and use Auth::setUser()
@joselfonseca Thanks! I am updating my packages.
Hi,
First of all, thank you for this package, it's very helpful.
I've tried to use the social login GQL query as mentioned in the documentation. https://lighthouse-passport-auth.web.app/docs/default-schema/
But I've got this error:
"message": "Method Illuminate\\Auth\\RequestGuard::onceUsingId does not exist."
at: HasSocialLogin.php > Auth::onceUsingId($user->id)I found that it would work with
Auth::guard('web')->onceUsingId($user->id)
but then it would not sync withSocialLogin@solve
because it's still using the default guard (API).This is a preview of the api middlewares used:
I may doing it wrong. I would appreciate some guidance if it were the case.
Thank you in advance