I am currently building a service using laravel and I am trying to find a way to authenticate guests into the members only area. This guest authentication will of course only be avaliable to those who have the special guest link.
So far my solution is this:
- On guest login, register a user with guest redentials (random username, random email, and guest set to 1)
- Using
Auth::attempt
log the user into the systen - Redirect user to the members page which now is open
This solution works for me except for the fact that I have several membership pages and would only like to give guest access to one of them. I am not exactly sure how to go about that without having to modify the Auth middleware which I would like to avoid for git purposes.
The auth middleware is on all pages thats need authentification.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire