feat(auth): enable users to delete their account #164
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 48s

This commit is contained in:
Tim
2024-09-11 18:17:44 +02:00
parent 59b064a63c
commit 2458c413d5
5 changed files with 129 additions and 15 deletions

View File

@@ -30,11 +30,13 @@ func getHandler(db *sql.DB) http.Handler {
// Don't use auth middleware for these routes, as it makes redirecting very difficult, if the mail is not yet verified
router.Handle("/auth/signin", service.HandleSignInPage(db))
router.Handle("/auth/signup", service.HandleSignUpPage(db))
router.Handle("/auth/verify", service.HandleSignUpVerifyPage(db)) // Hint for the user to verify their email
router.Handle("/auth/verify", service.HandleSignUpVerifyPage(db)) // Hint for the user to verify their email
router.Handle("/auth/delete-account", service.HandleDeleteAccountPage(db))
router.Handle("/auth/verify-email", service.HandleSignUpVerifyResponsePage(db)) // The link contained in the email
router.Handle("/api/auth/signup", service.HandleSignUpComp(db))
router.Handle("/api/auth/signin", service.HandleSignInComp(db))
router.Handle("/api/auth/signout", service.HandleSignOutComp(db))
router.Handle("/api/auth/delete-account", service.HandleDeleteAccountComp(db))
router.Handle("/api/auth/verify-resend", service.HandleVerifyResendComp(db))
return middleware.Logging(middleware.EnableCors(router))