Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
691d64b
fixed issue with dashes in csrf exempt
josephmancuso Jul 28, 2019
01feb95
removed unused import
josephmancuso Jul 28, 2019
c238ee8
flake8
josephmancuso Jul 28, 2019
1a6635b
started live reloading
josephmancuso Aug 10, 2019
5a0f37f
added live reloading
josephmancuso Aug 10, 2019
0e44095
fixed test template
josephmancuso Aug 10, 2019
56704ec
fixed unused import
josephmancuso Aug 10, 2019
d2f0c56
added auth dir in AuthCommand to move controllers to controllers/auth/
gdhameeja Aug 15, 2019
ed426d7
fixed issue with logging in with multiple authentications
josephmancuso Aug 17, 2019
63250a7
added Python 3.8 and removed 3.4 from circle build
josephmancuso Aug 17, 2019
b6491ec
fixed 3.8 image
josephmancuso Aug 17, 2019
d5e0a6b
added crednetials for 38
josephmancuso Aug 17, 2019
de77c6b
fixed indent
josephmancuso Aug 17, 2019
0bd4836
changed python image
josephmancuso Aug 17, 2019
20c8762
fixed python tag
josephmancuso Aug 17, 2019
b1f9ebe
changed to circle image
josephmancuso Aug 17, 2019
68a13ea
fixed keyword issue for Python 3.8
josephmancuso Aug 17, 2019
cd72ad2
removed custom test message
josephmancuso Aug 17, 2019
fc32c91
Merge pull request #876 from MasoniteFramework/feature/874
josephmancuso Aug 17, 2019
8aacc31
fixes issue with caching of route params
josephmancuso Aug 19, 2019
70b5b13
Merge pull request #880 from MasoniteFramework/fix/879
josephmancuso Aug 19, 2019
9919c23
Merge branch 'fix/810' of https://github.com/MasoniteFramework/core i…
josephmancuso Aug 19, 2019
8448bb0
removed print statement
josephmancuso Aug 19, 2019
2edb87b
removed comment
josephmancuso Aug 19, 2019
4c84f16
Merge pull request #844 from MasoniteFramework/fix/810
josephmancuso Aug 19, 2019
1c0dc2b
added tags to config
josephmancuso Aug 20, 2019
abe1d87
fixed indent
josephmancuso Aug 20, 2019
3073de3
merged 2.2 into master
josephmancuso Aug 20, 2019
e10e371
fixed spacing issue in config
josephmancuso Aug 20, 2019
7237840
added orb
josephmancuso Aug 20, 2019
0e3959a
Merge pull request #881 from MasoniteFramework/master
josephmancuso Aug 20, 2019
743212b
bumped version
josephmancuso Aug 20, 2019
5ec60be
fixed config
josephmancuso Aug 21, 2019
761dbd9
updated config
josephmancuso Aug 21, 2019
91998bf
fixed integer to string config
josephmancuso Aug 21, 2019
a7de249
fixed job name
josephmancuso Aug 21, 2019
cbb2cd1
removed quotes
josephmancuso Aug 21, 2019
c61ed17
fixed default environment branch
josephmancuso Aug 21, 2019
fcea26a
fixed issue with async driver
josephmancuso Aug 21, 2019
ae65825
fixed unused variable
josephmancuso Aug 21, 2019
8458fd7
added blocking support
josephmancuso Aug 21, 2019
9acaab5
got rid of comments
josephmancuso Aug 22, 2019
14eb5d3
Merge pull request #883 from MasoniteFramework/fix/882
josephmancuso Aug 22, 2019
aa986ba
bumped version
josephmancuso Aug 22, 2019
c746d5b
Merge branch '2.2' of https://github.com/MasoniteFramework/core into 2.2
josephmancuso Aug 22, 2019
774f135
got rid of blank space
josephmancuso Aug 22, 2019
d807b65
bumped versions
josephmancuso Aug 22, 2019
375b3e3
fixed amqp driver
josephmancuso Aug 22, 2019
5c4a12b
rearranged circleci tests
josephmancuso Aug 23, 2019
2c2348d
Merge branch 'fix/amqp-driver' of https://github.com/MasoniteFramewor…
josephmancuso Aug 23, 2019
527aa26
linted
josephmancuso Aug 23, 2019
2a4ef6e
fixed channel wrong state error
josephmancuso Aug 23, 2019
415cb6f
Merge pull request #884 from MasoniteFramework/fix/amqp-driver
josephmancuso Aug 23, 2019
adffcca
bumped version
josephmancuso Aug 23, 2019
ae7cd04
fixed passing variables from route to middleware
josephmancuso Aug 26, 2019
0f0f3c5
added assertPathIs and request property
josephmancuso Aug 26, 2019
286596a
linted
josephmancuso Aug 26, 2019
53f3f97
linted mockroute file
josephmancuso Aug 26, 2019
d5d0062
removed unused imports
josephmancuso Aug 26, 2019
e809608
Merge pull request #885 from MasoniteFramework/fix/middleware
josephmancuso Aug 26, 2019
246ffc2
bumped version
josephmancuso Aug 26, 2019
2cdc016
added warning to options routes
josephmancuso Aug 29, 2019
99215c0
Merge branch '2.2' of https://github.com/MasoniteFramework/core
josephmancuso Aug 29, 2019
20d16cb
linted
josephmancuso Aug 29, 2019
623c107
Merge pull request #886 from MasoniteFramework/fix/871
josephmancuso Aug 29, 2019
2e59d5c
fixed email manager signature
josephmancuso Aug 29, 2019
b67d86c
specified path in routers for controllers as auth.*
gdhameeja Aug 29, 2019
aacc3cf
removed storage module from container
josephmancuso Aug 31, 2019
95ceca3
removed cache config
josephmancuso Aug 31, 2019
8c05d5a
removed storage config from being imported
josephmancuso Aug 31, 2019
0bfe591
removed application config from container
josephmancuso Aug 31, 2019
aa9dcba
removed providers config
josephmancuso Aug 31, 2019
31216a4
removed providers config
josephmancuso Aug 31, 2019
068e85e
linted
josephmancuso Aug 31, 2019
667bf53
Merge branch 'master' into fix-777
gdhameeja Sep 2, 2019
94a20b7
fixed issue with config helper not getting False values
josephmancuso Sep 7, 2019
375d645
added a responsable class and mail is responsable
josephmancuso Sep 8, 2019
54abac3
config circleci config
josephmancuso Sep 8, 2019
9cd1ed7
config
josephmancuso Sep 8, 2019
c11bc38
fixed install
josephmancuso Sep 8, 2019
2075823
fixed issue with hasjson and dict dot keys
josephmancuso Sep 10, 2019
16556be
added asDictionary testcase method
josephmancuso Sep 10, 2019
b3ec450
Merge pull request #895 from MasoniteFramework/fix/893
josephmancuso Sep 10, 2019
75d07f8
fixed dictionary test
josephmancuso Sep 10, 2019
f27904c
fixed for python 3.4
josephmancuso Sep 10, 2019
4ce501a
Merge pull request #896 from MasoniteFramework/feature/894
josephmancuso Sep 10, 2019
752eca6
bumped version
josephmancuso Sep 10, 2019
ed147d6
Merge branch '2.2' of https://github.com/MasoniteFramework/core
josephmancuso Sep 10, 2019
c6904b4
added queue database driver
josephmancuso Sep 11, 2019
1b5921d
fixed queue jobs snippet
josephmancuso Sep 12, 2019
55de062
fixed queue job table
josephmancuso Sep 12, 2019
0a63d01
reflector run_middleware
Sep 12, 2019
9bce918
Added connection ability to migrate and database queue driver
josephmancuso Sep 14, 2019
9e8b8ad
Merge pull request #897 from MasoniteFramework/feature/599
josephmancuso Sep 14, 2019
842eb0c
Merge pull request #898 from erhuabushuo/2.2
josephmancuso Sep 14, 2019
9d83be4
Merge branch 'master' into feature/870
josephmancuso Sep 14, 2019
e440ccd
Merge pull request #873 from MasoniteFramework/feature/870
josephmancuso Sep 14, 2019
ea41cdf
Merge pull request #875 from gdhameeja/fix-777
josephmancuso Sep 14, 2019
31548e1
Merge branch 'develop' into feature/891
josephmancuso Sep 14, 2019
85a26c7
Merge pull request #892 from MasoniteFramework/feature/891
josephmancuso Sep 14, 2019
500caba
bumped version
josephmancuso Sep 14, 2019
f85c632
fixed queue connection
josephmancuso Sep 14, 2019
b416f9f
fixed database queue driver connection
josephmancuso Sep 14, 2019
5a9c769
fixed database queue connection issue
josephmancuso Sep 14, 2019
1f27b96
format
josephmancuso Sep 14, 2019
da771f1
added a package container class
josephmancuso Sep 19, 2019
22a471a
mail class now uses its own view class
josephmancuso Sep 20, 2019
275fafa
fixed mail driver
josephmancuso Sep 20, 2019
776966a
fixed view class resolver
josephmancuso Sep 20, 2019
6c27a7a
copied view class in mail class
josephmancuso Sep 20, 2019
d959e5c
Merge pull request #903 from MasoniteFramework/fix/mail-queues
josephmancuso Sep 20, 2019
8012fb7
bumped version
josephmancuso Sep 20, 2019
c941b40
Add ability to set reply-to of an email
carc1n0gen Sep 20, 2019
f9f5379
Update mail tests with reply-to
Sep 20, 2019
3995023
Cleanup unused view constructor parameter for email drivers
Sep 20, 2019
e6a6259
updated exception_handler.py to return json response if the client ma…
garyburgmann Sep 21, 2019
c462860
Merge pull request #905 from garyburgmann/exception_handler_header_up…
josephmancuso Sep 21, 2019
6495dbe
linted application
josephmancuso Sep 21, 2019
827b134
Merge pull request #904 from carc1n0gen/2.2
josephmancuso Sep 21, 2019
d1737a2
Merge pull request #906 from MasoniteFramework/master
josephmancuso Sep 22, 2019
aed2859
bumped version
josephmancuso Sep 22, 2019
3b5f2ad
Adding the old function responsible by recover old value submitted fr…
Marlysson Sep 22, 2019
e804d01
Checking if the session has the requested key.
Marlysson Sep 22, 2019
323d0ed
Fixing errors from DeepSource CI.
Marlysson Sep 22, 2019
ebf85cd
directly returning a Paginator or LengthAwarePaginator instance from …
garyburgmann Sep 28, 2019
1132c1a
fixed extra spae typo
garyburgmann Sep 28, 2019
acf6def
we can use pop method to get first element and remove it
Sep 28, 2019
d487624
Merge pull request #911 from erhuabushuo/2.2
josephmancuso Sep 29, 2019
b3b98b7
Merge branch 'feature-909' of https://github.com/garyburgmann/core in…
josephmancuso Sep 29, 2019
07b6f1b
feature-909. Tests written for Paginator and LengthAwarePaginator ins…
garyburgmann Oct 2, 2019
4b7c4c9
Merge branch 'feature-909' of https://github.com/garyburgmann/core in…
josephmancuso Oct 5, 2019
18c22ba
Merge branch '2.2' of https://github.com/MasoniteFramework/core into …
josephmancuso Oct 6, 2019
422aed1
refactored response tests and created several test helpers
josephmancuso Oct 6, 2019
2d50a02
Merge branch 'feature/845' of https://github.com/Marlysson/core into …
josephmancuso Oct 6, 2019
2f29e4a
added with_input and fixed old helper method
josephmancuso Oct 6, 2019
492f5f4
added default to old helper
josephmancuso Oct 6, 2019
d90603c
bumped version
josephmancuso Oct 6, 2019
6236948
Merge pull request #915 from MasoniteFramework/master
josephmancuso Oct 6, 2019
853c4d8
added optional route helpers
josephmancuso Oct 8, 2019
0154b13
formatted file
josephmancuso Oct 8, 2019
c2a604e
fixed issue with run on matching
josephmancuso Oct 8, 2019
f119abd
fixed route helper command
josephmancuso Oct 9, 2019
3441ec9
fixed potential issues with self argument not resolving
josephmancuso Oct 10, 2019
660ce66
Merge pull request #918 from MasoniteFramework/fix/self-resolving
josephmancuso Oct 10, 2019
b1cb9ad
Merge pull request #917 from MasoniteFramework/feature/916
josephmancuso Oct 11, 2019
d558c0f
Merge branch '2.2' of https://github.com/MasoniteFramework/core
josephmancuso Oct 11, 2019
6f4fea7
fixed issue with cleaning when bytes
josephmancuso Oct 15, 2019
84ee918
Merge branch '2.2' of https://github.com/MasoniteFramework/core
josephmancuso Oct 15, 2019
4cdaa5b
added exception listeners
josephmancuso Oct 15, 2019
3e98a30
added exception listener tests
josephmancuso Oct 15, 2019
f45883f
added listeners module to setup file
josephmancuso Oct 15, 2019
4f129d0
added file and line to exceptions
josephmancuso Oct 15, 2019
9970b9e
linted
josephmancuso Oct 15, 2019
b4395bd
Update __version__.py
josephmancuso Oct 15, 2019
d978a80
updated ambiguous error
josephmancuso Oct 18, 2019
60d6261
Merge pull request #921 from MasoniteFramework/feature/920
josephmancuso Oct 18, 2019
17020a9
added Python 3.8 to build
josephmancuso Oct 19, 2019
81e5e8f
removed message from assertion
josephmancuso Oct 19, 2019
4c74e17
Merge pull request #923 from MasoniteFramework/feature/922
josephmancuso Oct 19, 2019
b680581
Merge branch 'develop' into refactor-2.3
josephmancuso Oct 20, 2019
9ad0111
Merge pull request #889 from MasoniteFramework/refactor-2.3
josephmancuso Oct 20, 2019
1d1517a
:Merge branch 'master' of https://github.com/MasoniteFramework/core i…
josephmancuso Oct 20, 2019
10efd7a
refactored for tests
josephmancuso Oct 21, 2019
26690ff
more refactoring
josephmancuso Oct 21, 2019
7a01afb
refactored drivers
josephmancuso Oct 21, 2019
f3609bc
refactored
josephmancuso Oct 21, 2019
db30083
finished src refactor
josephmancuso Oct 21, 2019
2d006d8
fixed version
josephmancuso Oct 21, 2019
4a9ef4e
Merge pull request #927 from MasoniteFramework/feature/src
josephmancuso Oct 21, 2019
f2fcd57
Merge branch '2.2' of https://github.com/MasoniteFramework/core into 2.2
josephmancuso Oct 23, 2019
b9e0db3
removed sanity print
josephmancuso Oct 23, 2019
28fcc35
bumped version
josephmancuso Oct 23, 2019
1490c4e
meged 2.2 into develop
josephmancuso Oct 27, 2019
b6e9083
fixed tests between 2.2 and 2.3
josephmancuso Oct 27, 2019
bfbeb32
fixed duplicate error for circleci
josephmancuso Oct 27, 2019
a967cd6
removed duplicate key in build steps
josephmancuso Oct 27, 2019
abee88b
removed unused imports
josephmancuso Oct 27, 2019
9555e69
cleaned up deepsource issues
josephmancuso Oct 27, 2019
4eb18e6
added xcsrf
josephmancuso Oct 27, 2019
e5cbcb9
fixed csrf
josephmancuso Oct 27, 2019
96a5db7
removed random src file
josephmancuso Oct 27, 2019
035cc5a
bumped version
josephmancuso Oct 27, 2019
79fbc06
Merge pull request #929 from MasoniteFramework/fix/csrf-header
josephmancuso Oct 27, 2019
52c774f
convert to string before bytes
josephmancuso Oct 27, 2019
b3d1359
bumped to 2.3 version
josephmancuso Oct 27, 2019
08155a4
added str to byets
josephmancuso Oct 27, 2019
7f41d87
fixed manifest file
josephmancuso Oct 28, 2019
f28dddb
bumped validation version
josephmancuso Oct 28, 2019
5c88b8c
removed requirements
josephmancuso Oct 28, 2019
47d5ca5
fixed classifier
josephmancuso Oct 28, 2019
dea5fcd
fixed readme issues
josephmancuso Oct 28, 2019
2169637
users now login immediately
josephmancuso Oct 29, 2019
5e499fe
merged 2.2
josephmancuso Oct 29, 2019
0aaac9f
bumped version
josephmancuso Oct 29, 2019
cdb47da
Merge pull request #930 from MasoniteFramework/fix/ajax-user
josephmancuso Oct 29, 2019
4619b2a
modifying tests
josephmancuso Oct 30, 2019
d8ad94c
merged
josephmancuso Oct 30, 2019
b78cdcc
improved authentication system with guards
josephmancuso Oct 30, 2019
cc28fad
guards must be registered
josephmancuso Oct 30, 2019
de2e46d
fixed guards
josephmancuso Oct 31, 2019
35d4224
added authentication provider
josephmancuso Oct 31, 2019
ac747a1
added guard middleware
josephmancuso Oct 31, 2019
ac70f3d
merged 2.2 into develop
josephmancuso Oct 31, 2019
b0f30eb
Merge branch 'develop' into feature/931
josephmancuso Oct 31, 2019
553d15d
fixed guard test
josephmancuso Oct 31, 2019
0983c7e
removed references to testsuite class
josephmancuso Oct 31, 2019
0632a45
fixed circleci orb
josephmancuso Nov 2, 2019
6865b7c
added base authentication guard
josephmancuso Nov 2, 2019
8582535
added comments
josephmancuso Nov 2, 2019
cfe4749
fixed response exception block
josephmancuso Nov 2, 2019
db79421
linted
josephmancuso Nov 2, 2019
e24a218
Merge pull request #932 from MasoniteFramework/feature/931
josephmancuso Nov 2, 2019
11392ac
Merge branch 'develop' into feature/933
josephmancuso Nov 2, 2019
a7a8665
fixed middleware test
josephmancuso Nov 2, 2019
5efafb4
fixed conflicts
josephmancuso Nov 2, 2019
fab6a0f
fixed unused imports
josephmancuso Nov 2, 2019
a91ebd9
linted
josephmancuso Nov 2, 2019
1e5c551
Merge pull request #934 from MasoniteFramework/feature/933
josephmancuso Nov 2, 2019
44ad8fc
linted
josephmancuso Nov 2, 2019
ec1bf8e
fixed skipcq rules
josephmancuso Nov 2, 2019
5561d1f
linted
josephmancuso Nov 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 62 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,124 @@
version: 2.1

commands:
install:
steps:
- run: pip install . --user
- run: pip install -r requirements.txt --user

jobs:
build:
docker:
- image: circleci/python:3.6 # primary container for the build job
steps:
- checkout
- run: make
- run: make ci
python34:
- install
- run: make test
lint:
docker:
- image: circleci/python:3.4
- image: circleci/python:3.6 # primary container for the build job
steps:
- checkout
- run: make
- run: make ci
- install
- run: make lint
python35:
docker:
- image: circleci/python:3.5
steps:
- checkout
- run: make
- run: make ci
python37:
docker:
- image: circleci/python:3.7
steps:
- checkout
- run: make
- run: make ci
MasoniteValidation:
- install
- run: make test
python37:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.8.0b2-buster
auth:
username: jmancuso9 # can specify string literal values
password: $DOCKERHUB_PASSWORD
steps:
- checkout
- run: python trigger_build.py --repo masoniteframework/validation --branch circle-ci --build MASONITE_DEPENDENT_BRANCH=$CIRCLE_BRANCH
MasoniteAPI:
- install
- run: make test
python38:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.8
steps:
- checkout
- run: python trigger_build.py --repo masoniteframework/api --branch 2.2 --build BUILD_BRANCH=$CIRCLE_BRANCH
- run: make
- run: make test
CodeCoverage:
docker:
- image: circleci/python:3.6
steps:
- checkout
- install
- run: pip install -r requirements.txt --user
- run: make coverage
- run: make deepsource

orbs:
masonite: masonite/trigger@dev:latest
masonite: masonite/trigger@1.0.0

workflows:
version: 2
build_and_test:
jobs:
- build:
- build: # Python 3.6
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
- python34:
only: /^.*/
- lint: # Python 3.6
requires:
- build
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
only: /^.*/
- python35:
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
only: /^.*/
- python37:
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
- MasoniteValidation:
only: /^.*/
- python38:
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^.*/
- CodeCoverage:
requires:
- build
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
- MasoniteAPI:
only: /^.*/
- masonite/trigger:
name: MasoniteValidation
repo: masoniteframework/validation
branch: circle-ci
environment: MASONITE_DEPENDENT_BRANCH=${CIRCLE_BRANCH:-2.2}
requires:
- build
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
- CodeCoverage:
only: /^.*/
- masonite/trigger:
name: MasoniteAPI
repo: masoniteframework/api
branch: "2.2"
environment: BUILD_BRANCH=${CIRCLE_BRANCH:-2.2}
requires:
- build
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /^v*/
only: /^.*/
- masonite/deploy:
username: josephmancuso
password: $PYPI_PASSWORD
requires:
- MasoniteValidation
- MasoniteAPI
- CodeCoverage
- MasoniteValidation
- MasoniteAPI
- CodeCoverage
filters:
tags:
only: /^v*/
branches:
ignore: /.*/
tags:
only: /^.*/
branches:
ignore: /.*/
4 changes: 2 additions & 2 deletions .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ version = 1

test_patterns = [
'tests/**/*.py',
'masonite/testing/*.py',
'masonite/testsuite/*.py',
'src/masonite/testing/*.py',
'src/masonite/testsuite/*.py',
'testpackage/*.py'
]

Expand Down
14 changes: 7 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include masonite/snippets/exceptions/css/*
include masonite/snippets/exceptions/*
include masonite/snippets/*
include masonite/snippets/migrations/*
include masonite/snippets/scaffold/*
include masonite/snippets/auth/controllers/*
include masonite/snippets/auth/templates/auth/*
include src/masonite/snippets/exceptions/css/*
include src/masonite/snippets/exceptions/*
include src/masonite/snippets/*
include src/masonite/snippets/migrations/*
include src/masonite/snippets/scaffold/*
include src/masonite/snippets/auth/controllers/*
include src/masonite/snippets/auth/templates/auth/*
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ ci:
make test
make lint
lint:
python -m flake8 masonite/ --ignore=E501,F401,E128,E402,E731,F821,E712,W503
python -m flake8 src/masonite/ --ignore=E501,F401,E128,E402,E731,F821,E712,W503
deepsource:
curl https://deepsource.io/cli | sh
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
coverage:
python -m pytest --cov-report term --cov-report xml --cov=masonite tests/
python -m pytest --cov-report term --cov-report xml --cov=src/masonite tests/
python -m coveralls
publish:
pip install 'twine>=1.5.0'
Expand Down
70 changes: 70 additions & 0 deletions app/http/controllers/ConfirmController.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""The ConfirmController Module."""
import datetime

from src.masonite.auth import Auth, MustVerifyEmail
from src.masonite.auth.Sign import Sign
from src.masonite.managers import MailManager
from src.masonite.request import Request
from src.masonite.view import View
from src.masonite.helpers import config


class ConfirmController:
"""The ConfirmController class."""

def __init__(self):
"""The ConfirmController Constructor."""
pass

def verify_show(self, view: View, auth: Auth):
"""Show the Verify Email page for unverified users.

Arguments:
request {masonite.request.request} -- The Masonite request class.
request {masonite.view.view} -- The Masonite view class.
request {masonite.auth.auth} -- The Masonite Auth class.

Returns:
[type] -- [description]
"""
return view.render('auth/verify', {'app': config('application'), 'Auth': auth})

def confirm_email(self, request: Request, view: View, auth: Auth):
"""Confirm User email and show the correct response.

Arguments:
request {masonite.request.request} -- The Masonite request class.
request {masonite.view.view} -- The Masonite view class.
request {masonite.auth.auth} -- The Masonite Auth class.

Returns:
[type] -- [description]
"""
sign = Sign()
token = sign.unsign(request.param('id'))

if token is not None:
tokenParts = token.split("::")
if len(tokenParts) > 1:
user = auth.auth_model.find(tokenParts[0])

if user.verified_at is None:
timestamp = datetime.datetime.fromtimestamp(float(tokenParts[1]))
now = datetime.datetime.now()
timestamp_plus_10 = timestamp + datetime.timedelta(minutes=10)

if now < timestamp_plus_10:
user.verified_at = datetime.datetime.now()
user.save()

return view.render('auth/confirm', {'app': config('application'), 'Auth': auth})

return view.render('auth/error', {'app': config('application'), 'Auth': auth})

def send_verify_email(self, manager: MailManager, request: Request):
user = request.user()

if isinstance(user, MustVerifyEmail):
user.verify_email(manager, request)

return request.redirect('/home')
4 changes: 2 additions & 2 deletions app/http/controllers/ControllerTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from masonite.request import Request
from masonite.view import View
from src.masonite.request import Request
from src.masonite.view import View


class ControllerTest:
Expand Down
19 changes: 15 additions & 4 deletions app/http/controllers/TestController.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from app.jobs.TestJob import TestJob
from masonite import Queue
from masonite.request import Request
from src.masonite import Queue, Mail
from src.masonite.request import Request
from src.masonite.view import View

class TestController:

Expand All @@ -10,6 +11,9 @@ def __init__(self):
def show(self):
return 'show'

def v(self, view: View):
return view.render('test')

def change_header(self, request: Request):
request.header('Content-Type', 'application/xml')
return 'test'
Expand All @@ -25,8 +29,8 @@ def change_404(self, request: Request):
def testing(self):
return 'test'

def json_response(self, request: Request):
return {'id': 1}
def json_response(self):
return {'id': 2}

def post_test(self):
return 'post_test'
Expand All @@ -37,6 +41,10 @@ def json(self):
def bad(self):
return 5 / 0

def keyerror(self):
x = {'hello': 'world'}
return x['test']

def session(self, request: Request):
request.session.set('test', 'value')
return 'session set'
Expand All @@ -45,3 +53,6 @@ def queue(self, queue: Queue):
# queue.driver('amqp').push(self.bad)
queue.driver('amqp').push(TestJob, channel='default')
return 'queued'

def mail(self, mail: Mail):
return mail.to('idmann509@gmail.com').template('test', {'test': 'mail'})
9 changes: 6 additions & 3 deletions app/http/controllers/UnitTestController.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A UnitTestController Module."""

from masonite.request import Request
from masonite.controllers import Controller
from src.masonite.request import Request
from src.masonite.controllers import Controller


class UnitTestController(Controller):
Expand Down Expand Up @@ -36,7 +36,7 @@ def json(self):
def response(self):
return {
'count': 5,
'iterable': [1,2,3]
'iterable': [1, 2, 3]
}

def multi(self):
Expand All @@ -46,6 +46,9 @@ def multi(self):
}
}

def multi_count(self):
return {"count": 5, "iterable": [1, 2, 3]}

def patch(self):
return self.request.input('test')

Expand Down
7 changes: 3 additions & 4 deletions app/http/controllers/WelcomeController.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""Welcome The User To Masonite."""

from masonite.view import View
from masonite.request import Request
from masonite.controllers import Controller
from src.masonite.view import View
from src.masonite.controllers import Controller


class WelcomeController(Controller):
"""Controller For Welcoming The User."""

def show(self, view: View, request: Request):
def show(self, view: View):
"""Show the welcome page.

Arguments:
Expand Down
Loading