]> BookStack Code Mirror - bookstack/commit
Change email confirmation from own middle to trait
authorDan Brown <redacted>
Mon, 30 Dec 2019 15:46:12 +0000 (15:46 +0000)
committerDan Brown <redacted>
Mon, 30 Dec 2019 15:49:20 +0000 (15:49 +0000)
commit6f1b88a6a6402c7acfdd3e9bef72f50eb5e975c1
tree01facc2efcd58e14a704a69afcca8194a8c1b351
parent349b4629bef25e4631c1024749726415507b2cd5
Change email confirmation from own middle to trait

Email confirmation middleware caused more mess than good, As caused
priority issues and it depended on auth actions. Instead its now a trai
used on auth middlewares.

Also used 'EncryptCookies' middleware on API instead of custom
decryption in custom middleware since we'd need to do replicate all the
same actions anyway. Shouldn't have too much effect since it only
actions over cookies that exist, of which none should be there for most
API requests.

Also split out some large guard functions to be a little more readable
and appease codeclimate.
app/Api/ApiTokenGuard.php
app/Http/Kernel.php
app/Http/Middleware/ApiAuthenticate.php
app/Http/Middleware/Authenticate.php
app/Http/Middleware/ChecksForEmailConfirmation.php [new file with mode: 0644]
app/Http/Middleware/ConfirmEmails.php [deleted file]
app/Http/Middleware/StartSessionIfCookieExists.php