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

Allow using login for API routes without session #235

Closed
wants to merge 1 commit into from

Conversation

kohenkatz
Copy link

It is useful to use the same AuthenticatesUsers trait for login via API as for login in the browser, because the trait provides things like throttling and validation.

The problem is similar to the discussion in #208 - API routes may not have a session.

This PR adds if ($request->hasSession()) { the same as the comments in #208 suggest.

This also replaces #90 properly.

It is useful to use the same `AuthenticatesUsers` trait for login via API as for login in the browser, because the trait provides things like throttling and validation.

The problem is similar to the discussion in laravel#208 - API routes may not have a session.

This PR adds `if ($request->hasSession()) {` the same as the comments in laravel#208 suggest.

This also replaces laravel#90 properly.
@taylorotwell
Copy link
Member

I would suggest just changing the code in your own application if you need this.

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