summary refs log tree commit diff
path: root/src/api/middlewares/Authentication.ts
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-01-19 11:15:12 -0500
committerPuyodead1 <puyodead@protonmail.com>2023-02-23 21:35:51 -0500
commita47d80b255f1501e39bebd7ad7e80119c8ed1697 (patch)
treeeca3d1ff4a837efb8dfcc1571279c2f72f529e99 /src/api/middlewares/Authentication.ts
parentadd missing copyright headers (diff)
downloadserver-a47d80b255f1501e39bebd7ad7e80119c8ed1697.tar.xz
Email verification works
- Added /auth/verify to authenticated route whitelist
- Updated /auth/verify to properly mark a user as verified, return a response, and fix expiration time check
- Implemented /auth/verify/resend
- Moved verification email sending to a helper method
- Fixed VerifyEmailSchema requiring captcha_key
Diffstat (limited to 'src/api/middlewares/Authentication.ts')
-rw-r--r--src/api/middlewares/Authentication.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts

index ea0aa312..f4c33963 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts
@@ -16,10 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { NextFunction, Request, Response } from "express"; -import { HTTPError } from "lambert-server"; import { checkToken, Config, Rights } from "@fosscord/util"; import * as Sentry from "@sentry/node"; +import { NextFunction, Request, Response } from "express"; +import { HTTPError } from "lambert-server"; export const NO_AUTHORIZATION_ROUTES = [ // Authentication routes @@ -28,6 +28,7 @@ export const NO_AUTHORIZATION_ROUTES = [ "/auth/location-metadata", "/auth/mfa/totp", "/auth/mfa/webauthn", + "/auth/verify", // Routes with a seperate auth system "/webhooks/", // Public information endpoints