Class CountRecoveryCodesUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.totp.CountRecoveryCodesUseCase
Use case that counts the recovery codes a user still has, so the UI can warn when few are left.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of unused codes at or below which the user is warned to generate new ones.private final RecoveryCodeRepositoryPort that stores the recovery codes. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOW_THRESHOLD
public static final int LOW_THRESHOLDNumber of unused codes at or below which the user is warned to generate new ones.- See Also:
-
recoveryCodeRepository
Port that stores the recovery codes.
-
-
Constructor Details
-
CountRecoveryCodesUseCase
public CountRecoveryCodesUseCase()
-
-
Method Details
-
execute
Counts the unused codes.- Parameters:
userId- identifier of the user.- Returns:
- the number of unused codes.
-