Don't force user to log out when requesting new permissions#1069
Don't force user to log out when requesting new permissions#1069
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughConsolidates permission and refresh-token checks to a single consent flow, removes the separate permissions error page, adds a client-side reconnect flow using a shared account-linking URL resolver, and introduces an "update_tokens" handling path in OAuth callbacks to refresh tokens for already-linked accounts. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant Client as Consent Page (client)
participant API as /api/{provider}/linking
participant OAuth as OAuth Provider
participant Callback as /api/{provider}/linking/callback
participant DB
User->>Browser: Click "Reconnect account"
Browser->>Client: handleReconnect(provider)
Client->>API: GET /api/{provider}/linking (getAccountLinkingUrl)
API-->>Client: { url }
Client->>Browser: window.location = url
Browser->>OAuth: User authenticates + grants consent
OAuth->>Callback: Redirect to /api/{provider}/linking/callback?code=...
Callback->>Callback: handleAccountLinking(...)
alt existing linked account -> update_tokens
Callback->>DB: update tokens (access, refresh, expires_at, scope, token_type)
Callback-->>Browser: 302 -> /accounts?result=tokens_updated
else new account created
Callback->>DB: create account and persist tokens
Callback-->>Browser: 302 -> /accounts?result=success
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (12)apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
Files:
**/{server,api,actions,utils}/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Files:
**/*.ts📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{tsx,ts,css}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
!(pages/_document).{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Files:
**/*.test.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Files:
**/*.{test,spec}.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
🧠 Learnings (12)📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:37:56.430ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:37:56.430ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:40:00.833ZApplied to files:
📚 Learning: 2025-11-25T14:38:08.183ZApplied to files:
📚 Learning: 2025-11-25T14:38:08.183ZApplied to files:
📚 Learning: 2025-11-25T14:38:08.183ZApplied to files:
🧬 Code graph analysis (1)apps/web/utils/oauth/account-linking.test.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (4)
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 |
Route users missing permissions to in-app consent and add token refresh update flow for Google and Microsoft linking callbacks to avoid forced logoutUnify permission checks to route to 📍Where to StartStart with the permission routing in Macroscope summarized fca3aab. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/utils/oauth/account-linking.ts (1)
25-30: All callers correctly handle the newupdate_tokensreturn type; consider using switch statements for exhaustiveness safetyThe new
{ type: "update_tokens"; existingAccountId }branch is already properly handled in both consumers:
apps/web/app/api/google/linking/callback/route.ts(lines 208–244): updates tokens for existing accountapps/web/app/api/outlook/linking/callback/route.ts(lines 275–311): updates tokens for existing accountBoth callers also handle the other three union members (
redirect,continue_create, andmerge). However, the current pattern uses chainedifstatements rather than an exhaustive switch, which means TypeScript won't catch missed cases if the return type changes in the future. Consider refactoring to a discriminated union switch statement for stronger type safety and clarity.
🧹 Nitpick comments (4)
apps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsx (1)
24-31: Unified redirect condition matches new consent flowThe merged condition on
hasAllPermissions/hasRefreshTokencorrectly routes both failure cases to/permissions/consent, which aligns with the new permissions UX and avoids the old logout/error flow.You might optionally:
- Handle
result?.serverErrorfromcheckPermissionsAction(e.g., viatoastError) so genuine backend errors don’t silently no-op.- Early‑return if
!emailAccountIdbefore calling the action, to be extra defensive against transient undefined states.apps/web/utils/account-linking.ts (1)
1-28: Centralized linking URL helper is solid; consider sharing provider typeThe helper cleanly abstracts provider‑specific
/api/*/linking/auth-urldetails and returns a simpleurlstring, which is exactly what the callers need.Given
"google" | "microsoft"now appears in multiple places (here,AddAccount, permissions consent, and OAuth linking), consider extracting a shared type alias (e.g.type EmailProvider = "google" | "microsoft") into a small shared types file to avoid drift and follow the “centralize shared types” guideline.apps/web/app/api/outlook/linking/callback/route.ts (1)
282-325: Microsoft token‑update flow looks good; expiresAt logic could be sharedThe
update_tokensbranch correctly:
- Reuses the same
expiresAtcalculation as the create branch,- Updates the relevant token fields,
- Logs before and after,
- Stores
{ success: "tokens_updated" }and redirects with a matching query param while clearing the state cookie.To avoid future drift, you might extract the
expiresAtcomputation fromtokensinto a small helper used by both the create and update paths.apps/web/app/(app)/accounts/AddAccount.tsx (1)
9-31: Add‑account flow correctly reusesgetAccountLinkingUrland new provider unionSwitching
handleAddAccountto accept"google" | "microsoft"and delegating URL resolution togetAccountLinkingUrl(provider)nicely removes duplicated fetch logic and keeps both buttons wired through a single code path. The Outlook/Microsoft button now correctly callshandleAddAccount("microsoft"), matching the provider string used on the backend.Given this and other files use the same provider union, centralizing a shared provider type (as noted in the utils comment) would help keep things in sync long term, but the current implementation is functionally sound.
Also applies to: 55-56
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
apps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsx(1 hunks)apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsx(2 hunks)apps/web/app/(app)/[emailAccountId]/permissions/error/page.tsx(0 hunks)apps/web/app/(app)/accounts/AddAccount.tsx(2 hunks)apps/web/app/(landing)/login/LoginForm.tsx(0 hunks)apps/web/app/api/google/linking/callback/route.ts(1 hunks)apps/web/app/api/outlook/linking/callback/route.ts(1 hunks)apps/web/utils/account-linking.ts(1 hunks)apps/web/utils/oauth/account-linking.ts(2 hunks)version.txt(1 hunks)
💤 Files with no reviewable changes (2)
- apps/web/app/(landing)/login/LoginForm.tsx
- apps/web/app/(app)/[emailAccountId]/permissions/error/page.tsx
🧰 Additional context used
📓 Path-based instructions (21)
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use@/path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type filesImport specific lodash functions rather than entire lodash library to minimize bundle size (e.g.,
import groupBy from 'lodash/groupBy')
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
**/*.{ts,tsx}: For API GET requests to server, use theswrpackage
Useresult?.serverErrorwithtoastErrorfrom@/components/Toastfor error handling in async operations
**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
**/*.{ts,tsx}: For early access feature flags, create hooks using the naming conventionuse[FeatureName]Enabledthat return a boolean fromuseFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming conventionuse[FeatureName]Variantthat define variant types, useuseFeatureFlagVariantKey()with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g.,inbox-cleaner,pricing-options-2)
Always define types for A/B test variant flags (e.g.,type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting
**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the!postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Useas constinstead of literal types and type annotations
Use eitherT[]orArray<T>consistently
Initialize each enum member value explicitly
Useexport typefor types
Use `impo...
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/{server,api,actions,utils}/**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
**/{server,api,actions,utils}/**/*.ts: UsecreateScopedLoggerfrom "@/utils/logger" for logging in backend code
Add thecreateScopedLoggerinstantiation at the top of the file with an appropriate scope name
Use.with()method to attach context variables only within specific functions, not on global loggers
For large functions with reused variables, usecreateScopedLogger().with()to attach context once and reuse the logger without passing variables repeatedly
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/api/outlook/linking/callback/route.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Always import Prisma enums from
@/generated/prisma/enumsinstead of@/generated/prisma/clientto avoid Next.js bundling errors in client componentsImport Prisma using the project's centralized utility:
import prisma from '@/utils/prisma'
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma'sselectoption. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. AllfindUnique/findFirstcalls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
AllfindManyqueries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g.,emailAccount: { id: emailAccountId }) to validate ownership
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/api/outlook/linking/callback/route.ts
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Usenext/imagepackage for images
For API GET requests to server, use theswrpackage with hooks likeuseSWRto fetch data
For text inputs, use theInputcomponent withregisterPropsfor form integration and error handling
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/*.{tsx,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Implement responsive design with Tailwind CSS using a mobile-first approach
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{js,jsx,ts,tsx}: Don't useaccessKeyattribute on any HTML element
Don't setaria-hidden="true"on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like<marquee>or<blink>
Only use thescopeprop on<th>elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assigntabIndexto non-interactive HTML elements
Don't use positive integers fortabIndexproperty
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include atitleelement for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
AssigntabIndexto non-interactive HTML elements witharia-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include atypeattribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden witharia-hidden)
Always include alangattribute on the html element
Always include atitleattribute for iframe elements
AccompanyonClickwith at least one of:onKeyUp,onKeyDown, oronKeyPress
AccompanyonMouseOver/onMouseOutwithonFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
!(pages/_document).{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Don't use the next/head module in pages/_document.js on Next.js projects
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsversion.txtapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g.,import groupBy from 'lodash/groupBy')
Files:
apps/web/utils/account-linking.tsapps/web/app/api/google/linking/callback/route.tsapps/web/utils/oauth/account-linking.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
apps/web/app/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Follow NextJS app router structure with (app) directory
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/api/outlook/linking/callback/route.tsapps/web/app/(app)/accounts/AddAccount.tsx
apps/web/app/api/**/*.ts
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/app/api/**/*.ts: Wrap GET API routes withwithAuthorwithEmailAccountmiddleware for authentication
Export response types from GET API routes usingAwaited<ReturnType<>>pattern for type-safe client usage
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
apps/web/app/api/**/route.ts
📄 CodeRabbit inference engine (.cursor/rules/fullstack-workflow.mdc)
apps/web/app/api/**/route.ts: Create GET API routes usingwithAuthorwithEmailAccountmiddleware inapps/web/app/api/*/route.ts, export response types asGetExampleResponsetype alias for client-side type safety
Always export response types from GET routes asGet[Feature]Responseusing type inference from the data fetching function for type-safe client consumption
Do NOT use POST API routes for mutations - always use server actions withnext-safe-actioninstead
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
**/app/**/route.ts
📄 CodeRabbit inference engine (.cursor/rules/get-api-route.mdc)
**/app/**/route.ts: Always wrap GET API route handlers withwithAuthorwithEmailAccountmiddleware for consistent error handling and authentication in Next.js App Router
Infer and export response type for GET API routes usingAwaited<ReturnType<typeof functionName>>pattern in Next.js
Use Prisma for database queries in GET API routes
Return responses usingNextResponse.json()in GET API routes
Do not use try/catch blocks in GET API route handlers when usingwithAuthorwithEmailAccountmiddleware, as the middleware handles error handling
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
apps/web/app/**/[!.]*/route.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Use kebab-case for route directories in Next.js App Router (e.g.,
api/hello-world/route)
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
apps/web/app/api/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/security-audit.mdc)
apps/web/app/api/**/*.{ts,tsx}: API routes must usewithAuth,withEmailAccount, orwithErrormiddleware for authentication
All database queries must include user scoping withemailAccountIdoruserIdfiltering in WHERE clauses
Request parameters must be validated before use; avoid direct parameter usage without type checking
Use generic error messages instead of revealing internal details; throwSafeErrorinstead of exposing user IDs, resource IDs, or system information
API routes should only return necessary fields usingselectin database queries to prevent unintended information disclosure
Cron endpoints must usehasCronSecretorhasPostCronSecretto validate cron requests and prevent unauthorized access
Request bodies should use Zod schemas for validation to ensure type safety and prevent injection attacks
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
**/app/api/**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
**/app/api/**/*.ts: ALL API routes that handle user data MUST use appropriate middleware: usewithEmailAccountfor email-scoped operations, usewithAuthfor user-scoped operations, or usewithErrorwith proper validation for public/custom auth endpoints
UsewithEmailAccountmiddleware for operations scoped to a specific email account, including reading/writing emails, rules, schedules, or any operation usingemailAccountId
UsewithAuthmiddleware for user-level operations such as user settings, API keys, and referrals that use onlyuserId
UsewithErrormiddleware only for public endpoints, custom authentication logic, or cron endpoints. For cron endpoints, MUST usehasCronSecret()orhasPostCronSecret()validation
Cron endpoints without proper authentication can be triggered by anyone. CRITICAL: All cron endpoints MUST validate cron secret usinghasCronSecret(request)orhasPostCronSecret(request)and capture unauthorized attempts withcaptureException()
Always validate request bodies using Zod schemas to ensure type safety and prevent invalid data from reaching database operations
Maintain consistent error response format across all API routes to avoid information disclosure while providing meaningful error feedback
Files:
apps/web/app/api/google/linking/callback/route.tsapps/web/app/api/outlook/linking/callback/route.ts
apps/web/**/*.tsx
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss for class sorting
Prefer functional components with hooks over class components
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Use LoadingContent component for async data with loading and error states
Files:
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
apps/web/app/(app)/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
apps/web/app/(app)/**/*.{ts,tsx}: Components for the page are either put inpage.tsx, or in theapps/web/app/(app)/PAGE_NAMEfolder
If we're in a deeply nested component we will useswrto fetch via API
If you need to useonClickin a component, that component is a client component and file must start withuse client
Files:
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.tsx: Use theLoadingContentcomponent to handle loading states instead of manual loading state management
For text areas, use theInputcomponent withtype='text',autosizeTextareaprop set to true, andregisterPropsfor form integration
Files:
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use bothchildrenanddangerouslySetInnerHTMLprops on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use<>...</>instead of<Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't usetarget="_blank"withoutrel="noopener"
Don't use<img>elements in Next.js projects
Don't use<head>elements in Next.js projects
Files:
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
🧠 Learnings (7)
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to apps/web/utils/gmail/**/*.{ts,tsx} : Always use wrapper functions from @/utils/gmail/ for Gmail API operations instead of direct provider API calls
Applied to files:
apps/web/utils/account-linking.tsapps/web/app/(app)/accounts/AddAccount.tsx
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to apps/web/utils/gmail/**/*.{ts,tsx} : Keep Gmail provider-specific implementation details isolated within the apps/web/utils/gmail/ directory
Applied to files:
apps/web/utils/account-linking.tsapps/web/app/(app)/accounts/AddAccount.tsx
📚 Learning: 2025-07-08T13:14:07.449Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 537
File: apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx:30-34
Timestamp: 2025-07-08T13:14:07.449Z
Learning: The clean onboarding page in apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx is intentionally Gmail-specific and should show an error for non-Google email accounts rather than attempting to support multiple providers.
Applied to files:
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsxapps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
📚 Learning: 2025-11-25T14:39:23.326Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/security.mdc:0-0
Timestamp: 2025-11-25T14:39:23.326Z
Learning: Applies to app/api/**/*.ts : Use `withEmailAccount` middleware for operations scoped to a specific email account (reading/writing emails, rules, schedules, etc.) - provides `emailAccountId`, `userId`, and `email` in `request.auth`
Applied to files:
apps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsxapps/web/app/(app)/accounts/AddAccount.tsx
📚 Learning: 2025-11-25T14:39:49.448Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/server-actions.mdc:0-0
Timestamp: 2025-11-25T14:39:49.448Z
Learning: Applies to apps/web/utils/actions/*.ts : Use `actionClient` when both authenticated user context and a specific emailAccountId are needed, with emailAccountId bound when calling from the client
Applied to files:
apps/web/app/(app)/[emailAccountId]/PermissionsCheck.tsx
📚 Learning: 2025-11-25T14:39:27.909Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/security.mdc:0-0
Timestamp: 2025-11-25T14:39:27.909Z
Learning: Applies to **/app/api/**/*.ts : Use `withEmailAccount` middleware for operations scoped to a specific email account, including reading/writing emails, rules, schedules, or any operation using `emailAccountId`
Applied to files:
apps/web/app/(app)/accounts/AddAccount.tsx
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to **/*.{ts,tsx} : Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
Applied to files:
apps/web/app/(app)/accounts/AddAccount.tsx
🧬 Code graph analysis (3)
apps/web/utils/account-linking.ts (2)
apps/web/app/api/google/linking/auth-url/route.ts (1)
GetAuthLinkUrlResponse(11-11)apps/web/app/api/outlook/linking/auth-url/route.ts (1)
GetOutlookAuthLinkUrlResponse(10-10)
apps/web/app/api/google/linking/callback/route.ts (3)
apps/web/utils/redis/oauth-code.ts (1)
setOAuthCodeResult(43-53)apps/web/env.ts (1)
env(17-246)apps/web/utils/gmail/constants.ts (1)
GOOGLE_LINKING_STATE_COOKIE_NAME(16-16)
apps/web/app/(app)/accounts/AddAccount.tsx (1)
apps/web/utils/account-linking.ts (1)
getAccountLinkingUrl(9-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Review for correctness
- GitHub Check: test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
version.txt (1)
1-1: Version bump looks goodVersion updated to
v2.21.45; no behavioral impact and consistent with PR scope.apps/web/app/api/google/linking/callback/route.ts (1)
211-244: Token‑update branch for Google accounts is correct and symmetricThe
update_tokensbranch updates exactly the same token fields used on initial account creation, logs before/after, records{ success: "tokens_updated" }in the OAuth code result, and redirects with asuccess=tokens_updatedquery param while clearing the state cookie. This keeps the flow consistent with the existing create/merge branches and preserves the cached‑result/idempotence behavior above.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsx(2 hunks)apps/web/app/(landing)/login/LoginForm.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/app/(app)/[emailAccountId]/permissions/consent/page.tsx
🧰 Additional context used
📓 Path-based instructions (13)
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use@/path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type filesImport specific lodash functions rather than entire lodash library to minimize bundle size (e.g.,
import groupBy from 'lodash/groupBy')
Files:
apps/web/app/(landing)/login/LoginForm.tsx
apps/web/app/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Follow NextJS app router structure with (app) directory
Files:
apps/web/app/(landing)/login/LoginForm.tsx
apps/web/**/*.tsx
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss for class sorting
Prefer functional components with hooks over class components
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Use LoadingContent component for async data with loading and error states
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
**/*.{ts,tsx}: For API GET requests to server, use theswrpackage
Useresult?.serverErrorwithtoastErrorfrom@/components/Toastfor error handling in async operations
**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
**/*.{ts,tsx}: For early access feature flags, create hooks using the naming conventionuse[FeatureName]Enabledthat return a boolean fromuseFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming conventionuse[FeatureName]Variantthat define variant types, useuseFeatureFlagVariantKey()with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g.,inbox-cleaner,pricing-options-2)
Always define types for A/B test variant flags (e.g.,type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting
**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the!postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Useas constinstead of literal types and type annotations
Use eitherT[]orArray<T>consistently
Initialize each enum member value explicitly
Useexport typefor types
Use `impo...
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*Form.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/form-handling.mdc)
**/*Form.{ts,tsx}: Use React Hook Form with Zod for validation in form components
Validate form inputs before submission
Show validation errors inline next to form fields
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Always import Prisma enums from
@/generated/prisma/enumsinstead of@/generated/prisma/clientto avoid Next.js bundling errors in client componentsImport Prisma using the project's centralized utility:
import prisma from '@/utils/prisma'
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Usenext/imagepackage for images
For API GET requests to server, use theswrpackage with hooks likeuseSWRto fetch data
For text inputs, use theInputcomponent withregisterPropsfor form integration and error handling
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{tsx,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Implement responsive design with Tailwind CSS using a mobile-first approach
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.tsx: Use theLoadingContentcomponent to handle loading states instead of manual loading state management
For text areas, use theInputcomponent withtype='text',autosizeTextareaprop set to true, andregisterPropsfor form integration
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{js,jsx,ts,tsx}: Don't useaccessKeyattribute on any HTML element
Don't setaria-hidden="true"on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like<marquee>or<blink>
Only use thescopeprop on<th>elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assigntabIndexto non-interactive HTML elements
Don't use positive integers fortabIndexproperty
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include atitleelement for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
AssigntabIndexto non-interactive HTML elements witharia-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include atypeattribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden witharia-hidden)
Always include alangattribute on the html element
Always include atitleattribute for iframe elements
AccompanyonClickwith at least one of:onKeyUp,onKeyDown, oronKeyPress
AccompanyonMouseOver/onMouseOutwithonFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use bothchildrenanddangerouslySetInnerHTMLprops on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use<>...</>instead of<Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't usetarget="_blank"withoutrel="noopener"
Don't use<img>elements in Next.js projects
Don't use<head>elements in Next.js projects
Files:
apps/web/app/(landing)/login/LoginForm.tsx
!(pages/_document).{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Don't use the next/head module in pages/_document.js on Next.js projects
Files:
apps/web/app/(landing)/login/LoginForm.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g.,import groupBy from 'lodash/groupBy')
Files:
apps/web/app/(landing)/login/LoginForm.tsx
🧠 Learnings (10)
📚 Learning: 2025-11-25T14:37:09.306Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/fullstack-workflow.mdc:0-0
Timestamp: 2025-11-25T14:37:09.306Z
Learning: Applies to apps/web/components/**/*Form*.tsx : Handle form submission results using `result?.serverError` to show error toasts and `toastSuccess` to show success messages after server action completion
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:18.416Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-11-25T14:36:18.416Z
Learning: Applies to apps/web/components/**/*.tsx : Use `result?.serverError` with `toastError` and `toastSuccess` for error handling in form submissions
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:36.276Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/data-fetching.mdc:0-0
Timestamp: 2025-11-25T14:36:36.276Z
Learning: Applies to **/*.{ts,tsx} : Import error and success toast utilities from '@/components/Toast' for displaying notifications
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-07-08T13:14:07.449Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 537
File: apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx:30-34
Timestamp: 2025-07-08T13:14:07.449Z
Learning: The clean onboarding page in apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx is intentionally Gmail-specific and should show an error for non-Google email accounts rather than attempting to support multiple providers.
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:40.146Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/data-fetching.mdc:0-0
Timestamp: 2025-11-25T14:36:40.146Z
Learning: Applies to **/*.{ts,tsx} : Use `result?.serverError` with `toastError` from `@/components/Toast` for error handling in async operations
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:36.276Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/data-fetching.mdc:0-0
Timestamp: 2025-11-25T14:36:36.276Z
Learning: Applies to **/*.{ts,tsx} : Use `result?.serverError` with `toastError` and `toastSuccess` for error handling in server actions
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:18.416Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-11-25T14:36:18.416Z
Learning: Applies to apps/web/**/*.{ts,tsx} : Use proper error handling with try/catch blocks
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:38:07.606Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.606Z
Learning: Applies to apps/web/utils/ai/**/*.ts : Implement early returns for invalid LLM inputs, use proper error types and logging, implement fallbacks for AI failures, and add retry logic for transient failures using `withRetry`
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:37:09.306Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/fullstack-workflow.mdc:0-0
Timestamp: 2025-11-25T14:37:09.306Z
Learning: Applies to apps/web/components/**/*.tsx : Use `LoadingContent` component to consistently handle loading and error states, passing `loading`, `error`, and `children` props
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
📚 Learning: 2025-11-25T14:36:18.416Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-11-25T14:36:18.416Z
Learning: Applies to apps/web/**/*.tsx : Use LoadingContent component for async data with loading and error states
Applied to files:
apps/web/app/(landing)/login/LoginForm.tsx
🧬 Code graph analysis (1)
apps/web/app/(landing)/login/LoginForm.tsx (1)
apps/web/utils/config.ts (1)
WELCOME_PATH(24-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: test
- GitHub Check: Review for correctness
🔇 Additional comments (3)
apps/web/app/(landing)/login/LoginForm.tsx (3)
19-19: LGTM!The
toastErrorimport correctly follows the project's error-handling pattern and coding guidelines.
42-43: Excellent improvement to error handling!The
try/catch/finallypattern properly ensures that loading states are reset regardless of success or failure. This addresses the concern raised in the previous review aboutsetLoadingMicrosoft(false)not being called whensignIn.social()rejects.Also applies to: 61-62
31-35: Remove theerrorCallbackURLparameter—it's not supported by better-auth and is dead code.The
errorCallbackURL: "/login/error"parameter is not recognized by better-auth'ssignIn.social()method and serves no function. The only active error handling is the catch block withtoastError, which properly handles exceptions. The/login/errorroute exists but remains unreachable via this parameter. Remove theerrorCallbackURLline from both the Google and Microsoft sign-in handlers to avoid confusion about error-handling paths.⛔ Skipped due to learnings
Learnt from: elie222 Repo: elie222/inbox-zero PR: 537 File: apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx:30-34 Timestamp: 2025-07-08T13:14:07.449Z Learning: The clean onboarding page in apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx is intentionally Gmail-specific and should show an error for non-Google email accounts rather than attempting to support multiple providers.Learnt from: CR Repo: elie222/inbox-zero PR: 0 File: .cursor/rules/get-api-route.mdc:0-0 Timestamp: 2025-11-25T14:37:22.822Z Learning: Applies to **/app/**/route.ts : Do not use try/catch blocks in GET API route handlers when using `withAuth` or `withEmailAccount` middleware, as the middleware handles error handlingLearnt from: CR Repo: elie222/inbox-zero PR: 0 File: .cursor/rules/get-api-route.mdc:0-0 Timestamp: 2025-11-25T14:37:11.434Z Learning: Applies to **/app/**/route.ts : Do not use try/catch blocks in GET API route handlers as `withAuth` and `withEmailAccount` middleware handle error handling
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.