Adjusting les trucs que Max a demandé
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s

This commit is contained in:
LeoMoulin 2024-03-11 11:17:56 +01:00
parent dcf5b26b05
commit cfc6c59684

View File

@ -42,8 +42,9 @@ public class TokenService {
public void saveToken(Token token){
//Si l'utilisateur a déja 5 token delete celui qui devait expirer le plus vite
ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
if (tokenList.size() == 5){
while(tokenList.size() >= 5){
tokenRepo.delete(tokenList.get(0));
tokenList.remove(tokenList.get(0));
}
tokenRepo.save(token);
}