Skip to content

Conversation

@josephmancuso
Copy link
Member

@josephmancuso josephmancuso commented Oct 31, 2019

Guards are a quick and easy way to swap out the authentication logic down to the route level or during a specific request.

The way it works is we have a Guard class which is able to switch between different guards. By default, Masonite only has a web guard which gets the user from the cookie.

You can imagine there are other ways to get users. For example the API package might get a user based on an incoming token or based on a token in the request header.

This can be used exactly like the auth class now but can also swap between guards

Closes #931

@josephmancuso josephmancuso changed the title Feature/931 Auth Guards Feature/931 Oct 31, 2019
@coveralls
Copy link

coveralls commented Nov 2, 2019

Coverage Status

Coverage increased (+67.1%) to 76.307% when pulling db79421 on feature/931 into ac70f3d on develop.

@josephmancuso josephmancuso merged commit e24a218 into develop Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants