From 7368001e3bbbcae693b7f63d948b2b4331c7784a Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 19 Feb 2024 06:59:32 -0500 Subject: [PATCH] [+] Send confirmation email on register --- src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt b/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt index 59f0b9ee..5d8986d1 100644 --- a/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt +++ b/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt @@ -1,6 +1,7 @@ package icu.samnyan.aqua.net import ext.* +import icu.samnyan.aqua.net.components.EmailService import icu.samnyan.aqua.net.components.GeoIP import icu.samnyan.aqua.net.components.JWT import icu.samnyan.aqua.net.components.TurnstileService @@ -8,7 +9,6 @@ import icu.samnyan.aqua.net.db.AquaNetUser import icu.samnyan.aqua.net.db.AquaNetUserRepo import jakarta.servlet.http.HttpServletRequest import org.springframework.security.crypto.password.PasswordEncoder -import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @@ -19,6 +19,7 @@ class UserRegistrar( val userRepo: AquaNetUserRepo, val hasher: PasswordEncoder, val turnstileService: TurnstileService, + val emailService: EmailService, val geoIP: GeoIP, val jwt: JWT ) { @@ -69,7 +70,8 @@ class UserRegistrar( ) async { userRepo.save(u) } - // TODO: Send confirmation email + // Send confirmation email + emailService.sendConfirmation(u) return mapOf("success" to true) }