Skip to main content
Winnerr’s authentication system is built on Clerk with comprehensive multi-tenant organization support, providing secure access control for real estate brokerages of all sizes. The system ensures complete data isolation between organizations while maintaining seamless user experiences.

Authentication Architecture

Core Components

Clerk Integration

Modern authentication with social logins, MFA, and organization management

Multi-tenancy

Complete data isolation between real estate organizations

Role-based Access

Granular permissions for admins, agents, and viewers

API Security

JWT tokens with organization context validation

Authentication Flow

Organization Management

Organization Structure

Organization Creation Flow

Role-Based Access Control

Permission System

Role Definitions

Full access to all organization features:
  • All contact, deal, and property management
  • Organization settings and member management
  • Billing and subscription management
  • Phone system configuration
  • AI features and analytics
  • Data export and reporting
Access to CRM features with some restrictions:
  • Full contact and deal management
  • Property viewing and creation
  • Communication features
  • Phone system usage
  • AI features for productivity
  • Limited analytics access
Read-only access for assistants and support staff:
  • View contacts and deals
  • View properties and communications
  • Limited phone system access
  • Basic AI features

API Authentication

Middleware Implementation

API Route Protection

Multi-tenant Data Isolation

Database-Level Isolation

Application-Level Enforcement

Client-Side Authentication

React Components

API Calls with Authentication

Security Features

Session Management

Secure Sessions

JWT tokens with configurable expiration and automatic refresh

Multi-device Support

Secure sessions across web, mobile, and Chrome extension

Session Revocation

Immediate session termination for security incidents

Activity Monitoring

Login tracking and suspicious activity detection

Additional Security Measures

Organization Switching

Seamless Organization Context

Next Steps

Database Design

Explore the multi-tenant database schema

API Security

Learn about API security patterns and best practices

Real-time Features

Understand authenticated real-time communication

Security Note: Never store sensitive authentication data in client-side storage. Always use secure HTTP-only cookies or rely on Clerk’s session management.