Skip to content
36 changes: 18 additions & 18 deletions masonite/commands/AuthCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ def handle(self):
with open('routes/web.py', 'a') as f:
# add all the routes
f.write('\nROUTES = ROUTES + [\n ')
f.write("Get().route('/login', 'LoginController@show').name('login'),\n ")
f.write("Get().route('/logout', 'LoginController@logout').name('logout'),\n ")
f.write("Post().route('/login', 'LoginController@store'),\n ")
f.write("Get().route('/register', 'RegisterController@show').name('register'),\n ")
f.write("Post().route('/register', 'RegisterController@store'),\n ")
f.write("Get().route('/home', 'HomeController@show').name('home'),\n ")
f.write("Get().route('/email/verify', 'ConfirmController@verify_show').name('verify'),\n ")
f.write("Get().route('/email/verify/send', 'ConfirmController@send_verify_email'),\n ")
f.write("Get().route('/email/verify/@id:signed', 'ConfirmController@confirm_email'),\n ")
f.write("Get().route('/password', 'PasswordController@forget').name('forgot.password'),\n ")
f.write("Post().route('/password', 'PasswordController@send'),\n ")
f.write("Get().route('/password/@token/reset', 'PasswordController@reset').name('password.reset'),\n ")
f.write("Post().route('/password/@token/reset', 'PasswordController@update'),\n")
f.write("Get().route('/login', 'auth.LoginController@show').name('login'),\n ")
f.write("Get().route('/logout', 'auth.LoginController@logout').name('logout'),\n ")
f.write("Post().route('/login', 'auth.LoginController@store'),\n ")
f.write("Get().route('/register', 'auth.RegisterController@show').name('register'),\n ")
f.write("Post().route('/register', 'auth.RegisterController@store'),\n ")
f.write("Get().route('/home', 'auth.HomeController@show').name('home'),\n ")
f.write("Get().route('/email/verify', 'auth.ConfirmController@verify_show').name('verify'),\n ")
f.write("Get().route('/email/verify/@id:signed', 'auth.ConfirmController@confirm_email'),\n ")
f.write("Get().route('/email/verify/@id:signed', 'auth.ConfirmController@confirm_email'),\n ")
f.write("Get().route('/password', 'auth.PasswordController@forget').name('forgot.password'),\n ")
f.write("Post().route('/password', 'auth.PasswordController@send'),\n ")
f.write("Get().route('/password/@token/reset', 'auth.PasswordController@reset').name('password.reset'),\n ")
f.write("Post().route('/password/@token/reset', 'auth.PasswordController@update'),\n")
f.write(']\n')

# move controllers
shutil.copyfile(module_path + "/../snippets/auth/controllers/LoginController.py",
os.getcwd() + "/app/http/controllers/LoginController.py")
os.getcwd() + "/app/http/controllers/auth/LoginController.py")
shutil.copyfile(module_path + "/../snippets/auth/controllers/RegisterController.py",
os.getcwd() + "/app/http/controllers/RegisterController.py")
os.getcwd() + "/app/http/controllers/auth/RegisterController.py")
shutil.copyfile(module_path + "/../snippets/auth/controllers/HomeController.py",
os.getcwd() + "/app/http/controllers/HomeController.py")
os.getcwd() + "/app/http/controllers/auth/HomeController.py")
shutil.copyfile(module_path + "/../snippets/auth/controllers/ConfirmController.py",
os.getcwd() + "/app/http/controllers/ConfirmController.py")
os.getcwd() + "/app/http/controllers/auth/ConfirmController.py")
shutil.copyfile(module_path + "/../snippets/auth/controllers/PasswordController.py",
os.getcwd() + "/app/http/controllers/PasswordController.py")
os.getcwd() + "/app/http/controllers/auth/PasswordController.py")
# move templates
shutil.copytree(module_path + "/../snippets/auth/templates/auth",
os.getcwd() + "/resources/templates/auth")
Expand Down
9 changes: 3 additions & 6 deletions masonite/drivers/mail/BaseMailDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def __init__(self, app: App, view: View):
"""Base mail driver constructor.

Arguments:
MailConfig {module} -- This is the config.mail module.
View {object} -- This is the masonite.view.View class.
app {masonite.app.App} -- The Masonite container class.
view {object} -- This is the masonite.view.View class.
"""
self.config = app.make('MailConfig')
self.to_address = None
Expand All @@ -39,10 +39,7 @@ def to(self, user_email):
return self

def queue(self):
"""Set the user email address who you want to send mail to.

Arguments:
user_email {string} -- The user email address.
"""Whether the email should be queued or not when sending.

Returns:
self
Expand Down
3 changes: 3 additions & 0 deletions masonite/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ def __init__(self, route=None, output=None):
if route is not None and output is not None:
self.route(route, output)

print('The Masonite development server is not capable of handling OPTIONS preflight requests.')
print('You should use a more powerful server if using the Option')


class Trace(BaseHttpRoute):
"""Class for specifying Trace requests."""
Expand Down
3 changes: 2 additions & 1 deletion routes/web.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Web Routes."""

from masonite.routes import Get, Post, Redirect, RouteGroup, Patch
from masonite.routes import Get, Post, Redirect, RouteGroup, Patch, Options


ROUTES = [
Get().route('/test', None).middleware('auth'),
Get().route('/queue', 'TestController@queue'),
Options('options', 'TestController@show'),
Redirect('/redirect', 'test'),
Get().domain('test').route('/test', None).middleware('auth'),
Get().domain('test').route('/unit/test', 'TestController@testing').middleware('auth'),
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
install_requires=[
'bcrypt>=3.1,<3.2',
'cleo>=0.6,<0.7',
'cryptography>=2.3,<2.4',
'cryptography>=2.3,<2.8',
'hupper>=1.0,<2.0',
'Jinja2>=2,<3',
'masonite-events>=1.0,<2',
Expand All @@ -49,8 +49,8 @@
'orator>=0.9,<1',
'passlib>=1.7,<1.8',
'pendulum>=1.5,<1.6',
'psutil>=5.4,<5.5',
'python-dotenv>=0.8,<0.9',
'psutil>=5.4,<5.7',
'python-dotenv>=0.8,<0.11',
'requests>=2.0,<2.99',
'tabulate>=0.8,<0.9',
'tldextract>=2.2,<2.3',
Expand Down