From de5990fa62d141f7ba3fec98096e9b7f04f1516d Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 27 Jun 2022 23:05:17 +0200 Subject: [PATCH] add expire 5 minutes for mail --- src/main/java/com/covas/Resources/MailRessource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/covas/Resources/MailRessource.java b/src/main/java/com/covas/Resources/MailRessource.java index c006301..66731fc 100644 --- a/src/main/java/com/covas/Resources/MailRessource.java +++ b/src/main/java/com/covas/Resources/MailRessource.java @@ -16,7 +16,6 @@ import com.covas.Entity.UsersEntity; import io.quarkus.mailer.MailTemplate; import io.quarkus.redis.client.RedisClient; -import org.jboss.logging.Logger; @Path("mail") public class MailRessource { @@ -35,6 +34,7 @@ public class MailRessource { } String randomKey=UUID.randomUUID().toString(); redisClient.set(Arrays.asList(users.id.toString(),randomKey)); + redisClient.expire(users.id.toString(), "300"); mailer.to(users.email).subject(String.format("Compte %s créée", users.email)).data("name", users.pseudo).data("id",users.id).data("key",randomKey).send().subscribeAsCompletionStage(); return Response.ok().build(); }