Adjusting les trucs que Max a demandé
This commit is contained in:
parent
dcf5b26b05
commit
cfc6c59684
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user