feat: Implement comprehensive OAuth and email verification authentication system
- Add email verification with token-based validation - Integrate Google, Facebook, and Yahoo OAuth providers - Add OAuth configuration and email service modules - Update User model with email_verified, oauth_provider, oauth_id fields - Implement async password hashing/verification to prevent blocking - Add database migration script for new user fields - Create email verification page with professional UI - Update login page with social login buttons (Google, Facebook, Yahoo) - Add OAuth callback token handling - Implement scroll-to-top navigation component - Add 5-second real-time polling for Products and Services pages - Enhance About page with Apple-style scroll animations - Update Home and Contact pages with branding and business info - Optimize API cache with prefix-based clearing - Create comprehensive setup documentation and quick start guide - Fix login performance with ThreadPoolExecutor for bcrypt operations Performance improvements: - Login time optimized to ~220ms with async password verification - Real-time data updates every 5 seconds - Non-blocking password operations Security enhancements: - Email verification required for new accounts - OAuth integration for secure social login - Verification tokens expire after 24 hours - Password field nullable for OAuth users
This commit is contained in:
@@ -33,9 +33,18 @@ class User(Base):
|
||||
id = Column(String(36), primary_key=True, default=generate_uuid)
|
||||
email = Column(String(255), unique=True, nullable=False, index=True)
|
||||
name = Column(String(255), nullable=False)
|
||||
password = Column(String(255), nullable=False)
|
||||
password = Column(String(255), nullable=True) # Nullable for OAuth users
|
||||
role = Column(SQLEnum(UserRole), default=UserRole.USER)
|
||||
is_active = Column(Boolean, default=True, nullable=False)
|
||||
|
||||
# Email verification fields
|
||||
email_verified = Column(Boolean, default=False, nullable=False)
|
||||
verification_token = Column(String(500), nullable=True)
|
||||
|
||||
# OAuth fields
|
||||
oauth_provider = Column(String(50), nullable=True) # google, facebook, yahoo, or None for email
|
||||
oauth_id = Column(String(255), nullable=True) # User ID from OAuth provider
|
||||
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user