mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-08 21:07:27 +08:00
[+] Send confirmation email on register
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package icu.samnyan.aqua.net
|
package icu.samnyan.aqua.net
|
||||||
|
|
||||||
import ext.*
|
import ext.*
|
||||||
|
import icu.samnyan.aqua.net.components.EmailService
|
||||||
import icu.samnyan.aqua.net.components.GeoIP
|
import icu.samnyan.aqua.net.components.GeoIP
|
||||||
import icu.samnyan.aqua.net.components.JWT
|
import icu.samnyan.aqua.net.components.JWT
|
||||||
import icu.samnyan.aqua.net.components.TurnstileService
|
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 icu.samnyan.aqua.net.db.AquaNetUserRepo
|
||||||
import jakarta.servlet.http.HttpServletRequest
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder
|
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.PostMapping
|
||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
@@ -19,6 +19,7 @@ class UserRegistrar(
|
|||||||
val userRepo: AquaNetUserRepo,
|
val userRepo: AquaNetUserRepo,
|
||||||
val hasher: PasswordEncoder,
|
val hasher: PasswordEncoder,
|
||||||
val turnstileService: TurnstileService,
|
val turnstileService: TurnstileService,
|
||||||
|
val emailService: EmailService,
|
||||||
val geoIP: GeoIP,
|
val geoIP: GeoIP,
|
||||||
val jwt: JWT
|
val jwt: JWT
|
||||||
) {
|
) {
|
||||||
@@ -69,7 +70,8 @@ class UserRegistrar(
|
|||||||
)
|
)
|
||||||
async { userRepo.save(u) }
|
async { userRepo.save(u) }
|
||||||
|
|
||||||
// TODO: Send confirmation email
|
// Send confirmation email
|
||||||
|
emailService.sendConfirmation(u)
|
||||||
|
|
||||||
return mapOf("success" to true)
|
return mapOf("success" to true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user