feat: swap auId in JWT for individual token

note: has not been tested to ensure there are no collisions, todo
This commit is contained in:
Raymond
2025-07-27 03:06:33 -04:00
committed by Azalea
parent 82adf5c138
commit 39ed8af840
4 changed files with 155 additions and 76 deletions

View File

@@ -34,6 +34,7 @@ class UserRegistrar(
val cardService: CardService,
val validator: AquaUserServices,
val emailProps: EmailProperties,
val sessionRepo: SessionTokenRepo,
final val paths: PathProps
) {
val portraitPath = paths.aquaNetPortrait.path()
@@ -233,6 +234,12 @@ class UserRegistrar(
// Save the user
userRepo.save(u)
// Clear all tokens if changing password
if (key == "pwHash")
sessionRepo.deleteAll(
sessionRepo.findByAquaNetUserAuId(u.auId)
)
}
SUCCESS