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
This commit is contained in:
Puyodead1
2023-02-23 21:35:51 -05:00
committed by Puyodead1
parent cc6bf066b1
commit a47d80b255
7 changed files with 129 additions and 23 deletions
+3 -2
View File
@@ -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