Match changes to the Depot user repo commited in r....
Oh hello, git. I mean... "change 4e5882cb4b89bb084ba3a63d6060323a2b371f98". Yeah. Hm. Anyway, fix validation records so that we only store one and it corresponds to the latest email address.
This commit is contained in:
@@ -943,20 +943,16 @@ public class OOOUserRepository extends UserRepository
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a pending record for an account that has been created but not yet validated (which
|
* Creates a pending record for an account that has been created but not yet validated (which
|
||||||
* involves the user accessing a secret URL we send to them in an email message). If a record
|
* involves the user accessing a secret URL we send to them in an email message).
|
||||||
* already exists for the supplied user, it will be reused and returned.
|
|
||||||
*/
|
*/
|
||||||
public ValidateRecord createValidateRecord (int userId, boolean persist)
|
public ValidateRecord createValidateRecord (int userId, boolean persist)
|
||||||
throws PersistenceException
|
throws PersistenceException
|
||||||
{
|
{
|
||||||
// reuse an existing record if we have one
|
// delete any old validate mappings for the user
|
||||||
ValidateRecord rec = getValidateRecord(userId);
|
update("delete from penders where userId = '" + userId + "'");
|
||||||
if (rec != null) {
|
|
||||||
return rec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// otherwise create a new one and insert it into the database
|
// create a new one and insert it into the database
|
||||||
rec = new ValidateRecord();
|
ValidateRecord rec = new ValidateRecord();
|
||||||
rec.secret = Long.toString(Math.abs((new Random()).nextLong()), 16);
|
rec.secret = Long.toString(Math.abs((new Random()).nextLong()), 16);
|
||||||
rec.userId = userId;
|
rec.userId = userId;
|
||||||
rec.persist = persist;
|
rec.persist = persist;
|
||||||
|
|||||||
Reference in New Issue
Block a user