-
Notifications
You must be signed in to change notification settings - Fork 97
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
Stateless support - Illuminate\\Auth\\RequestGuard::loginUsingId does not exist #83
Comments
I encountered the same issue using this in my REST API... A workaround would be highly appreciated |
I found the source of the error: The handle function in Then found "loginUsingId" in the first IF block `
} and replaced DO NOT forget to include your user model at the begining of the file like this I also had to comment out the return statement in the IF block above before my change had any effect. PS: I believe this is safe since according to the comment in the file, that IF block is required ONLY to trigger the the Login Event which in turn only returns the user object. If anyone finds a better solution, I'd be glad to use it, but for now, this works for me besides the fact that my timezone is wrongly captured. |
I encountered a similar issue, and cedlinx provided a helpful workaround. In my case, I had a function for support where authorized people could access user accounts. I could get this error when calling an API using the Following cedlinx's suggestion, I found that the source of the error lies in the if ($event instanceof AccessTokenCreated) {
Auth::loginUsingId($event->userId);
return;
} cedlinx proposed a workaround by replacing the line It's important to note that before the proposed change takes effect, the I appreciate cedlinx's contribution, as this workaround resolved the issue for me. However, I'm open to other suggestions or alternative solutions from the community. |
It seems like this package doesn't support stateless requests (only web middleware). If we aren't using Web routes, we get
Illuminate\\Auth\\RequestGuard::loginUsingId does not exist
- how can we use this? Thanks for the help.The text was updated successfully, but these errors were encountered: