Package org.compiere.model
Class MPasswordResetToken
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_PasswordResetToken
org.compiere.model.MPasswordResetToken
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_AD_PasswordResetToken,I_Persistent,Evaluatee
Password reset token model.
Persists a single password-reset request: the emailed 6-digit code (encrypted at rest) and,
after the code is verified, the short-lived verified token (hashed) that authorizes
setting a new password. Auto-registered with the model factory as the leaf subclass
of the @Model-annotated X_AD_PasswordResetToken.
- Author:
- d-ruiz - IDEMPIERE-7060
- See Also:
-
Field Summary
Fields inherited from class org.compiere.model.X_AD_PasswordResetToken
TOKENSTATUS_AD_Reference_ID, TOKENSTATUS_Cancelled, TOKENSTATUS_Completed, TOKENSTATUS_Expired, TOKENSTATUS_Pending, TOKENSTATUS_VerifiedFields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, m_attachment, m_idOld, m_IDs, m_KeyColumns, m_optimisticLockingColumns, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_IDFields inherited from interface org.compiere.model.I_AD_PasswordResetToken
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_PasswordResetToken_ID, COLUMNNAME_AD_PasswordResetToken_UU, COLUMNNAME_AttemptsUsed, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_EMail, COLUMNNAME_Expiration, COLUMNNAME_IsActive, COLUMNNAME_OneTimeCode, COLUMNNAME_TokenStatus, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_VerifiedTokenExpires, COLUMNNAME_VerifiedTokenHash, Model, Table_ID, Table_Name -
Constructor Summary
ConstructorsConstructorDescriptionMPasswordResetToken(Properties ctx, int AD_PasswordResetToken_ID, String trxName) MPasswordResetToken(Properties ctx, int AD_PasswordResetToken_ID, String trxName, String... virtualColumns) MPasswordResetToken(Properties ctx, String AD_PasswordResetToken_UU, String trxName) MPasswordResetToken(Properties ctx, String AD_PasswordResetToken_UU, String trxName, String... virtualColumns) MPasswordResetToken(Properties ctx, ResultSet rs, String trxName) -
Method Summary
Modifier and TypeMethodDescriptionstatic intexpirePendingForEMail(String email, String trxName) Expire every still-pending reset token for the given email.intIncrement and store the used-attempts counter.booleanbooleanMethods inherited from class org.compiere.model.X_AD_PasswordResetToken
get_AccessLevel, getAD_PasswordResetToken_ID, getAD_PasswordResetToken_UU, getAttemptsUsed, getEMail, getExpiration, getOneTimeCode, getTokenStatus, getVerifiedTokenExpires, getVerifiedTokenHash, initPO, setAD_PasswordResetToken_ID, setAD_PasswordResetToken_UU, setAttemptsUsed, setEMail, setExpiration, setOneTimeCode, setTokenStatus, setVerifiedTokenExpires, setVerifiedTokenHash, toStringMethods inherited from class org.compiere.model.PO
afterDelete, afterInsertWithValues, afterSave, beforeDelete, beforeSave, buildInsertSQL, buildInsertSQL, buildUpdateSQL, buildUUIDSubquery, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, doOrganizationCheckForSave, doVerificationForDelete, doVerificationForSave, dump, dump, equals, firePostDeleteEvent, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_deleteStatement, get_deleteTranslationsSQL, get_deleteTreeSQL, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_QueryTimeout, get_Table_ID, get_TableAttribute, get_TableAttributeAsBoolean, get_TableAttributeAsInt, get_TableAttributes, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_ColumnLoaded, is_hasCustomTree, is_Immutable, is_new, is_Partial, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isCrossTenantSafe, isLogSQLScript, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lobSave, lock, makeImmutable, postDelete, resetStateAfterDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveFinish, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnLoaded, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_DocumentNoForNewRecord, set_IDForNewRecord, set_OptimisticLockingColumns, set_Partial, set_QueryTimeout, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_UUIDForNewRecord, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueForNewRecord, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, setupDeleteActionsForTransactionEvent, toInsertSQL, unlock, update_Tree, validForeignKeys, validForeignKeysExMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.compiere.model.I_AD_PasswordResetToken
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActiveMethods inherited from interface org.compiere.model.I_Persistent
save
-
Constructor Details
-
MPasswordResetToken
-
MPasswordResetToken
public MPasswordResetToken(Properties ctx, int AD_PasswordResetToken_ID, String trxName, String... virtualColumns) -
MPasswordResetToken
-
MPasswordResetToken
public MPasswordResetToken(Properties ctx, String AD_PasswordResetToken_UU, String trxName, String... virtualColumns) -
MPasswordResetToken
-
-
Method Details
-
expirePendingForEMail
Expire every still-pending reset token for the given email. Issuing a new code calls this so only the most recently emailed code remains verifiable.- Parameters:
email- token emailtrxName- transaction- Returns:
- number of tokens expired
-
isCodeExpired
public boolean isCodeExpired()- Returns:
- true if the reset code has expired (or no expiration set)
-
isVerifiedTokenExpired
public boolean isVerifiedTokenExpired()- Returns:
- true if the verified token has expired (or none/not yet verified)
-
incrementAttempts
public int incrementAttempts()Increment and store the used-attempts counter.- Returns:
- the new number of attempts used
-