def store_changed_password( self, auth: Auth, request: Request, response: Response ): # store password_reset record auth.reset_password(request.input("password"), request.input("token")) # Need to validate?? # Redirect back? return response.back()
def store(self, view: View, request: Request, auth: Auth, response: Response): login = auth.attempt(request.input("username"), request.input("password")) if login: return response.redirect(name="home") # Go back to login page return response.redirect(name="login")
def store(self, auth: Auth, request: Request, response: Response): # store register user user = auth.register(request.only("name", "email", "password")) if not user: return response.redirect("/register") return response.redirect("/home")
from src.masonite.routes import Route from src.masonite.broadcasting import Broadcast from src.masonite.authentication import Auth Route.get("/", "WelcomeController@show").name("welcome"), Route.post("/", "WelcomeController@show"), Route.post("/upload", "WelcomeController@upload").name("upload"), Route.get("/test", "WelcomeController@test"), Route.get("/emit", "WelcomeController@emit"), Route.get("/view", "WelcomeController@view"), Route.get("/mail", "MailableController@view"), Broadcast.routes() Auth.routes()
def store( self, auth: Auth, request: Request, response: Response ): # store password_reset record auth.password_reset(request.input("email")) return "event fired"