feat: Enhance SMS verification with new token handling and update API key
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m45s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 9m45s
This commit is contained in:
@@ -72,7 +72,7 @@ public class KavenegarService : IKavenegarService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task VerifyLookupAsync(string mobile, string token, string template = "Afrino")
|
||||
public async Task VerifyLookupAsync(string mobile, string token, string template = "OTP")
|
||||
{
|
||||
if (!_smsSettings.Enabled)
|
||||
{
|
||||
@@ -106,4 +106,41 @@ public class KavenegarService : IKavenegarService
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task VerifyLookupAsync(string mobile, string token, string token2, string template)
|
||||
{
|
||||
if (!_smsSettings.Enabled)
|
||||
{
|
||||
_logger.LogInformation("SMS is disabled. Skipping VerifyLookup to {Mobile}", mobile);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_kavenegarApi == null)
|
||||
{
|
||||
_logger.LogWarning("⚠️ Kavenegar API not initialized, cannot send VerifyLookup");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var result = _kavenegarApi.VerifyLookup(
|
||||
receptor: mobile,
|
||||
token: token,
|
||||
token2: token2,
|
||||
token3: "",
|
||||
template: template);
|
||||
|
||||
_logger.LogInformation("📱 VerifyLookup SMS sent to {Mobile} with template {Template} (token2), MessageId: {MessageId}",
|
||||
mobile, template, result.Messageid);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "❌ Kavenegar error sending VerifyLookup to {Mobile}: {Message}", mobile, ex.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user