|
<< Click to Display Table of Contents >> Navigation: Telegram > 2025 > 03 > 13 > Telegram_2025-03-13T14 |
2025-03-13T14:02:18
- generate your OTP using a function to generate random stuff, e.g.:
type: pre function GenerateOTP: string;
var
i: Integer;
begin
Result := '';
for i := 1 to 6 do
Result := Result + IntToStr(Random(10));
end; language:
2025-03-13T14:03:24
- save this OTP in your DB linked to the user that requested it. Add a expiration time (e.g. 1 to 3 minutes would be enough)
2025-03-13T14:04:38
- Send it to the user using your WhatsApp API (you can use Indy or IW internal HTTP client classes which I recommend)
2025-03-13T14:05:13
- When the user provides the OTP compare it with the one saved in the DB. Check the expiration.
- Grant or deny access based on the result.
That's it