Skip to content

fix(airtable): fix airtable oauth connection#1682

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/airtable
Oct 18, 2025
Merged

fix(airtable): fix airtable oauth connection#1682
waleedlatif1 merged 1 commit intostagingfrom
fix/airtable

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

fix airtable oauth connection, API was changed and they no longer returned name which is required by better-auth to create an acct, follows established pattern from other oauth providers

Type of Change

  • Bug fix

Testing

tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 18, 2025 5:10am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

Fixes Airtable OAuth connection by adding a custom getUserInfo handler to handle API changes where the name field is no longer returned.

  • Added custom getUserInfo implementation that derives username from email (using part before @) or falls back to 'Airtable User'
  • Creates fallback email using user ID if no email is provided
  • Follows the established pattern used by other OAuth providers (Jira, Confluence, Notion) for handling missing fields
  • Includes proper error handling and logging consistent with other providers
  • Sets emailVerified based on whether an actual email was returned from the API

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns from other OAuth providers in the same file (Jira, Confluence, Notion), includes proper error handling, and addresses a real API change from Airtable. The code is well-structured with appropriate fallbacks for missing data.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/lib/auth.ts 5/5 Added custom getUserInfo handler for Airtable OAuth to derive name from email after API change removed name field

Sequence Diagram

sequenceDiagram
    participant User
    participant App
    participant Airtable
    participant BetterAuth
    
    User->>App: Initiate Airtable OAuth
    App->>Airtable: Authorization Request
    Airtable->>User: Show consent screen
    User->>Airtable: Grant permission
    Airtable->>App: Return authorization code
    App->>Airtable: Exchange code for access token
    Airtable->>App: Return access token
    App->>Airtable: GET /v0/meta/whoami
    Airtable->>App: Return user data (id, email)
    App->>App: Extract username from email<br/>or use fallback 'Airtable User'
    App->>BetterAuth: Create account with derived name
    BetterAuth->>User: Authentication complete
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 90c34b2 into staging Oct 18, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/airtable branch October 18, 2025 05:15
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