Commit Graph

19 Commits

Author SHA1 Message Date
Nuno Maduro 55af5469c3
[10.x] Uses PHP Native Type Declarations 🐘 (#6010)
* Adds basic typing around method's arguments and return types

* Adds missing `closure` type

* Adds typing on tests

* Fixes `RedirectIfAuthenticated`

* Fixes `Authenticate`

* Improves `RedirectIfAuthenticated` types

* Fixes user factory `unverified` return type
2023-01-03 10:35:24 +01:00
Can Vural 40f93daa83
Update redirectTo return type PHPDoc 2019-12-14 11:48:14 +01:00
Dries Vints 6f3aa7a4c5
Don't redirect for api calls
When calling api routes the Authenticate middleware attempts to redirect you to the login page. If you expect JSON back or don't have auth routes then you don't want this to happen. By re-using the logic from Laravel's exception handler on which format to output we can also determine wether to redirect the user to the login page or give them a JSON error response.
2018-10-12 15:40:15 +02:00
Taylor Otwell a14e62325c customizable redirect on auth failure 2018-03-13 16:09:47 -05:00
Joseph Silber 945052508f Use the Authenticate middleware from core 2016-05-26 13:07:11 -04:00
Joseph Silber 6dfc0229b2 Make the Authenticate middleware throw an AuthenticationException 2016-05-22 14:50:39 -04:00
Joseph Silber f7d05cbbaa Set the default driver from the Authenticate middleware 2016-03-28 09:48:35 -04:00
Joseph Silber 703197e27a Allow passing multiple gaurds to the auth middleware 2016-03-17 10:22:19 -07:00
Jacob Bennett 5b3c5f3f4e Don't return a login page to a JSON request
Currently, any unauthorized API requests that pass through the `auth` middleware get a redirect to the login page. Adding the `wantsJson` flag to the conditional corrects this behavior.
2016-01-22 10:01:39 -06:00
Taylor Otwell 2ea2ae0f3f allow guard to be specified on middleaware 2015-12-05 21:56:17 -06:00
Taylor Otwell ba7137dcb0 update routes and middleware 2015-12-03 23:11:04 -06:00
Taylor Otwell 8414d45cdc update middleware and config 2015-12-03 12:25:38 -06:00
Graham Campbell bf3785d0bc Additional cs fixes
Signed-off-by: Graham Campbell <graham@cachethq.io>
2015-06-01 15:46:45 +01:00
Taylor Otwell 8909e75552 Some spacing. 2015-03-02 15:31:27 -06:00
Taylor Otwell 4c78958b5b Tweak a few things. 2015-02-22 22:37:16 -06:00
Taylor Otwell cc2139ac91 Tweaking a few things. 2015-02-22 21:56:03 -06:00
Taylor Otwell f424b87a63 PSR-2 for app. 2015-02-22 20:47:03 -06:00
Taylor Otwell caa166f5d6 Remove middleware interface. 2015-01-05 13:16:21 -06:00
Taylor Otwell ca2f02284c Rename middleware to more "action" words. 2014-11-11 12:51:55 -06:00