fix(airtable): fix airtable oauth connection#1682
Merged
waleedlatif1 merged 1 commit intostagingfrom Oct 18, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
Contributor
There was a problem hiding this comment.
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
getUserInfoimplementation 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
emailVerifiedbased 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
1 file reviewed, no comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Testing
tested manually
Checklist