Complete FrontOffice BFF to CMS Migration
- Migrated all 9 services from FrontOffice.BFF to CMS architecture - Enhanced user.proto with 7 additional Customer API endpoints: * UpdateCustomerProfile, GetCustomerProfile * ChangeCustomerPassword with validation * GetCustomerReferrals with commission stats * UploadCustomerAvatar with file validation * GetCustomerSettings, UpdateCustomerSettings - All services now support Customer endpoints with /Customer/ prefix - Mock implementations with realistic Persian data - Fixed namespace conflicts and compilation issues - Comprehensive testing completed for all endpoints - Services migrated: Categories, City, UserCarts, Products, UserWallet, Transaction, UserOrder, Package, User (enhanced)
This commit is contained in:
@@ -6,6 +6,8 @@ public class OtpToken : BaseAuditableEntity
|
||||
public string Mobile { get; set; }
|
||||
//مقصود
|
||||
public string Purpose { get; set; }
|
||||
//کد
|
||||
public string Code { get; set; }
|
||||
//کد هش شده
|
||||
public string CodeHash { get; set; }
|
||||
//زمان انقضا
|
||||
@@ -14,4 +16,16 @@ public class OtpToken : BaseAuditableEntity
|
||||
public int Attempts { get; set; }
|
||||
//موفق بود؟
|
||||
public bool IsUsed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Validates if the provided code is correct and token is not expired
|
||||
/// </summary>
|
||||
public bool IsValid(string providedCode)
|
||||
{
|
||||
if (IsUsed || DateTime.UtcNow > ExpiresAt)
|
||||
return false;
|
||||
|
||||
// Use BCrypt to verify the provided code against the stored hash
|
||||
return BCrypt.Net.BCrypt.Verify(providedCode, CodeHash);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user