Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce an email-based OTP authentication system replacing GitHub sign-in, enhance dashboard authorization with role-based permission checks, add user profile completion workflows, and restructure layout components. A new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client as Login Form
participant Auth as Better Auth
participant Email as Email Service
User->>Client: Enter email
Client->>Auth: sendVerificationOtp(email)
Auth->>Email: Send OTP
Email->>User: OTP delivered
User->>Client: Enter 6-digit OTP
Client->>Auth: signIn.emailOtp(otp)
Auth->>Client: Success response
Client->>User: Redirect to /dashboard
sequenceDiagram
participant User
participant DashboardLayout as Dashboard Layout
participant Auth as Server Session
participant TRPC as TRPC Query
participant Redirect as Router
User->>DashboardLayout: Access /dashboard
DashboardLayout->>Auth: getServerSession()
Auth->>DashboardLayout: Return session
DashboardLayout->>DashboardLayout: Check telegramId exists
alt Missing telegramId
DashboardLayout->>Redirect: redirect(/onboarding/link)
else Has telegramId
DashboardLayout->>TRPC: getRoles(telegramId)
TRPC->>DashboardLayout: Return roles
alt No roles
DashboardLayout->>Redirect: redirect(/onboarding/no-role)
else Has creator role
DashboardLayout->>Redirect: redirect(/onboarding/unauthorized)
else Has valid roles
DashboardLayout->>User: Render dashboard with children
end
end
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.