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

Change auth class #694

Closed
josephmancuso opened this issue May 7, 2019 · 0 comments
Closed

Change auth class #694

josephmancuso opened this issue May 7, 2019 · 0 comments
Labels
beta-3 Labels the issue with which beta version this issue applies to next major Issue scheduled for the next major release

Comments

@josephmancuso
Copy link
Member

josephmancuso commented May 7, 2019

There is a new way that classes are being resolved in 2.2 (currently in the develop branch).

now instead of doing this:

from masonite.auth import Auth

def show(self, request: Request):
    Auth(request).login(..)

we can now do this:

from masonite.auth import Auth

def show(self, auth: Auth):
    auth.login(..)

This is because now parameters that are classes (<class masonite.auth.Auth> type objects) are now resolved out of the container as they are resolved. Meaning we can resolve the auth constructor as it is resolved from the parameter list. This allows us to automatically resolve the auth initializer which will pass in the request class before we get the object for us.

@josephmancuso josephmancuso added next major Issue scheduled for the next major release beta-3 Labels the issue with which beta version this issue applies to labels May 7, 2019
@josephmancuso josephmancuso added beta-3 Labels the issue with which beta version this issue applies to and removed beta-3 Labels the issue with which beta version this issue applies to labels May 17, 2019
This was referenced May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-3 Labels the issue with which beta version this issue applies to next major Issue scheduled for the next major release
Projects
None yet
Development

No branches or pull requests

1 participant