mardi 28 juin 2016

Laravel 5.2 user management through RESTful API (looking for an alternative to Route::auth())

I would think this question has been asked 1,000 times, but I actually haven't been able to find it anywhere (at least not for Laravel 5.2). I'm trying to implement user admin functionality through a RESTful API (I'm not talking about OAuth2, I already got that up and running). Basically, I need all the stuff Route::auth() does through a web interface, but I want to do it without the web interface and without the redirects that Route::auth() returns.

It seems like I can send POST requests to the underlying routes of Route::auth() (register, login, logout, password...) and it properly validates the POST and acts, but there's no useful data returned and it always redirects to / as the response. For example, if I register a new user, it creates the account correctly and redirects to /, but there's no "success" message. If I try to register a new user with an email address that's already in the user table, it does the exact same thing (redirects to / with no other response) and I don't get any sort of response to tell my app that the user already exists.

Is there something I'm missing or do I need to re-write all of these routes and auth methods for proper API functionality?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2918vqg
via IFTTT

Aucun commentaire:

Enregistrer un commentaire