Skip to content

feat: update auth#3

Merged
shibadityadeb merged 1 commit into
mainfrom
connectors
Jul 14, 2026
Merged

feat: update auth#3
shibadityadeb merged 1 commit into
mainfrom
connectors

Conversation

@shibadityadeb

@shibadityadeb shibadityadeb commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added Google-only sign-in with automatic Google Workspace connection and synchronization.
    • Added post-sign-in handling that redirects users to the dashboard.
    • First-time sign-ins automatically provision accounts and workspace access.
  • Changes

    • Removed email/password registration and login in favor of “Continue with Google.”
    • Removed manual Google connection controls from the Connectors page.
    • Improved token refresh handling during concurrent requests.
  • Documentation

    • Updated setup and API documentation for the revised Google OAuth flow.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ce9e67bd-4032-4f91-a7da-b218a857498d

📥 Commits

Reviewing files that changed from the base of the PR and between 36c0ec0 and 04c2ecb.

📒 Files selected for processing (23)
  • .env.example
  • README.md
  • apps/api/prisma/migrations/20260714120000_google_oauth_signin/migration.sql
  • apps/api/prisma/schema.prisma
  • apps/api/src/config/env.ts
  • apps/api/src/modules/auth/auth.repository.ts
  • apps/api/src/modules/auth/auth.routes.ts
  • apps/api/src/modules/auth/auth.schemas.ts
  • apps/api/src/modules/auth/auth.service.ts
  • apps/api/src/modules/auth/google-signin.service.ts
  • apps/api/src/modules/connectors/connector.routes.ts
  • apps/api/src/modules/connectors/connector.schemas.ts
  • apps/api/src/modules/connectors/connector.service.ts
  • apps/api/src/modules/connectors/google-oauth.ts
  • apps/api/src/utils/password.ts
  • apps/api/tests/connector.schemas.test.ts
  • apps/api/tests/password.test.ts
  • apps/web/src/app/(app)/connectors/page.tsx
  • apps/web/src/app/(auth)/callback/page.tsx
  • apps/web/src/app/(auth)/login/page.tsx
  • apps/web/src/app/(auth)/register/page.tsx
  • apps/web/src/lib/api.ts
  • docs/connectors.md

📝 Walkthrough

Walkthrough

This change replaces email/password authentication with Google OAuth sign-in, provisions users and organizations, automatically establishes Google Workspace connections, and updates API routes, web pages, configuration, schema, and documentation accordingly.

Changes

Google OAuth sign-in

Layer / File(s) Summary
Identity model and Google user authentication
apps/api/prisma/*, apps/api/src/modules/auth/auth.schemas.ts, apps/api/src/modules/auth/auth.repository.ts, apps/api/src/modules/auth/auth.service.ts
User passwords become nullable; Google profiles create or authenticate users, assign the first user ADMIN, update login state, and support organization membership provisioning.
OAuth entrypoint and callback orchestration
apps/api/src/modules/auth/auth.routes.ts, apps/api/src/modules/auth/google-signin.service.ts, apps/api/src/modules/connectors/google-oauth.ts, .env.example, apps/api/src/config/env.ts
Google authorization URLs, signed callback state, token exchange, userinfo retrieval, organization resolution, refresh-cookie handling, and callback redirects are implemented.
Automatic connector provisioning
apps/api/src/modules/connectors/connector.routes.ts, apps/api/src/modules/connectors/connector.schemas.ts, apps/api/src/modules/connectors/connector.service.ts, apps/api/tests/connector.schemas.test.ts
Connector-initiated OAuth routes are removed; sign-in now creates or reuses Google connector records, stores credentials, publishes connection events, and starts synchronization workflows.
Web sign-in and documented flow
apps/web/src/app/(auth)/*, apps/web/src/app/(app)/connectors/page.tsx, apps/web/src/lib/api.ts, README.md, docs/connectors.md
The web app offers Google sign-in, completes authentication through the refresh cookie, removes manual connection controls, deduplicates refresh requests, and documents the updated flow.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant API
  participant Google
  participant AuthService
  participant ConnectorService
  participant WebApp
  Browser->>API: Start Google sign-in
  API->>Google: Redirect for authorization
  Google->>API: OAuth callback with code and state
  API->>Google: Exchange code and fetch profile
  API->>AuthService: Authenticate Google profile
  API->>ConnectorService: Establish Google connection
  API-->>Browser: Set refresh cookie and redirect
  Browser->>WebApp: Load callback page
  WebApp->>API: Complete sign-in refresh
  WebApp-->>Browser: Redirect to dashboard
Loading

Possibly related PRs

  • shibadityadeb/Context-Brain#2: Introduced the connector Google OAuth flow that this change relocates into authentication and automatic connection provisioning.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch connectors

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shibadityadeb
shibadityadeb merged commit d189368 into main Jul 14, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant