Christopher B
1/25/24, 11:39:11 AM EST
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_YEAR, -1); //24 hours
Date newerthan = cal.getTime();
Data found = searcher.query().exact("user",user.getId()).exact("securitycode",code).after("date",newerthan).searchOne();
Ian M
1/25/24, 11:41:09 AM EST
That still seems bad, people could request 5000 codes from the server
Christopher B
1/25/24, 11:42:07 AM EST
But that is true no matter what no? We need to throddle requests
Ian M
1/25/24, 11:42:28 AM EST
Well I think only code code should be active at a time
delete the old one each time a new one is created
delete the old one each time a new one is created