Created
February 23, 2022 12:46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OTPGenerator { | |
@InvocableMethod(description='This method will be generating the OTP for users to Login' | |
label='Generate OTP' | |
category='OTP') | |
public static List<String> generateOtp(){ | |
List<String> responseList = new List<String>(); | |
String randomIntegerString = string.valueof(Math.abs(Crypto.getRandomInteger())); | |
String otp = randomIntegerString.substring(0,6); | |
responseList.add(otp); | |
return responseList; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment