]> BookStack Code Mirror - bookstack/commit
Extracted API auth into guard
authorDan Brown <redacted>
Mon, 30 Dec 2019 14:51:28 +0000 (14:51 +0000)
committerDan Brown <redacted>
Mon, 30 Dec 2019 14:51:28 +0000 (14:51 +0000)
commit349b4629bef25e4631c1024749726415507b2cd5
tree80a79ddc6ce1bbdb662e95ebe17aefa2112766c7
parent3de55ee6454667e2d4b3cb866625a165ccb9aee3
Extracted API auth into guard

Also implemented more elegant solution to allowing session auth for API
routes; A new 'StartSessionIfCookieExists' middleware, which wraps the
default 'StartSession' middleware will run for API routes which only
sets up the session if a session cookie is found on the request. Also
decrypts only the session cookie.

Also cleaned some TokenController codeclimate warnings.
app/Api/ApiToken.php
app/Api/ApiTokenGuard.php [new file with mode: 0644]
app/Config/auth.php
app/Exceptions/ApiAuthException.php [new file with mode: 0644]
app/Http/Controllers/UserApiTokenController.php
app/Http/Kernel.php
app/Http/Middleware/ApiAuthenticate.php
app/Http/Middleware/StartSessionIfCookieExists.php [new file with mode: 0644]
app/Providers/AuthServiceProvider.php
Morty Proxy This is a proxified and sanitized view of the page, visit original site.