We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The function auth.attempt() should return the user model when the parameter once is set to True, but currently, it returns None instead.
auth.attempt()
once
True
None
auth.attempt() must return the user model when the credentials are valid whether the once parameter is set or not.
user = auth.attempt(request.input("email"), request.input("password"), once=True) if user: # user is always None print(user.id)
4.20.0
the Default WebGuard's attempt method can be rewritten to something like this:
attempt
masonite.authentication.guards.WebGuard.py
def attempt(self, username, password): attempt = self.options.get("model")().attempt(username, password) if attempt and not self.options.get("once"): self.application.make("response").cookie("token", attempt.remember_token) self.application.make("request").set_user(attempt) return attempt # change this line
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The function
auth.attempt()
should return the user model when the parameteronce
is set toTrue
, but currently, it returnsNone
instead.Expected behaviour
auth.attempt()
must return the user model when the credentials are valid whether theonce
parameter is set or not.Steps to reproduce the bug
Masonite Version
4.20.0
Anything else ?
the Default WebGuard's
attempt
method can be rewritten to something like this:masonite.authentication.guards.WebGuard.py
The text was updated successfully, but these errors were encountered: