Search in sources :

Example 1 with CodeStorageService

use of uk.gov.di.authentication.shared.services.CodeStorageService in project di-authentication-api by alphagov.

the class RedisExtension method generateAndSavePhoneNumberCode.

public String generateAndSavePhoneNumberCode(String email, long codeExpiryTime) {
    var code = new CodeGeneratorService().sixDigitCode();
    new CodeStorageService(redis).saveOtpCode(email, code, codeExpiryTime, VERIFY_PHONE_NUMBER);
    return code;
}
Also used : CodeStorageService(uk.gov.di.authentication.shared.services.CodeStorageService) CodeGeneratorService(uk.gov.di.authentication.shared.services.CodeGeneratorService)

Example 2 with CodeStorageService

use of uk.gov.di.authentication.shared.services.CodeStorageService in project di-authentication-api by alphagov.

the class RedisExtension method generateAndSaveEmailCode.

public String generateAndSaveEmailCode(String email, long codeExpiryTime) {
    var code = new CodeGeneratorService().sixDigitCode();
    new CodeStorageService(redis).saveOtpCode(email, code, codeExpiryTime, VERIFY_EMAIL);
    return code;
}
Also used : CodeStorageService(uk.gov.di.authentication.shared.services.CodeStorageService) CodeGeneratorService(uk.gov.di.authentication.shared.services.CodeGeneratorService)

Example 3 with CodeStorageService

use of uk.gov.di.authentication.shared.services.CodeStorageService in project di-authentication-api by alphagov.

the class RedisExtension method generateAndSaveMfaCode.

public String generateAndSaveMfaCode(String email, long codeExpiryTime) {
    var code = new CodeGeneratorService().sixDigitCode();
    new CodeStorageService(redis).saveOtpCode(email, code, codeExpiryTime, MFA_SMS);
    return code;
}
Also used : CodeStorageService(uk.gov.di.authentication.shared.services.CodeStorageService) CodeGeneratorService(uk.gov.di.authentication.shared.services.CodeGeneratorService)

Aggregations

CodeGeneratorService (uk.gov.di.authentication.shared.services.CodeGeneratorService)3 CodeStorageService (uk.gov.di.authentication.shared.services.CodeStorageService)3