Skip to content

[Chore] Update oauth schema to support more OAuth providers - #452

Merged
Fermionic-Lyu merged 2 commits into
mainfrom
chore-update-oauth-schema
Oct 16, 2025
Merged

Fermionic-Lyu merged 2 commits into
mainfrom
chore-update-oauth-schema

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented Oct 16, 2025 •

Copy link
Copy Markdown
Member

I am working on reviewing all the oauth PRs, and in order to support them, we need to first extend our shared-schemas and SDK. At the moment, if developer tries to add a login method that is not implemented yet, our backend simply returns 404. I want to refactor our backend auth route to use wildcard for providers, and use a switch statement to decide which provider to go. In this case, backend will return 400 provider not configured which is more comprehensive. But doing that will screw up some current PRs, so let me do this PR first, review & merge all current OAuth PRs, and then do the refactor. Maybe that can be another hacktoberfest issue as well.

Summary by CodeRabbit

  • New Features

    • Extended OAuth authentication to add Discord, LinkedIn, Facebook, Instagram, TikTok, Apple, X, Spotify, and Microsoft.
  • Chores

    • Updated package versions across the project.

@coderabbitai

coderabbitai Bot commented Oct 16, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Root package version changed from 1.1.1 to 1.1.0; shared-schemas package version bumped from 1.1.2 to 1.1.4. The auth schema expands the OAuth providers list and exports a new OAuthProvidersSchema type.

Changes

Cohort / File(s) Summary
Package Versioning
package.json, shared-schemas/package.json
Root package version changed from 1.1.1 to 1.1.0; shared-schemas/package.json version changed from 1.1.2 to 1.1.4.
OAuth Providers Expansion
shared-schemas/src/auth.schema.ts
oAuthProvidersSchema enum extended from ['google','github'] to include discord, linkedin, facebook, instagram, tiktok, apple, x, spotify, microsoft; new exported type OAuthProvidersSchema = z.infer<typeof oAuthProvidersSchema> added.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through versions, small and spry,
I found new friends beneath the sky—
Discord, Spotify, Microsoft, X,
LinkedIn, Apple, TikTok's next,
Our schema grows, a happy try! 🌿

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "[Chore] Update oauth schema to support more OAuth providers" directly corresponds to the primary changes in the changeset. The main modification is the expansion of the OAuth providers enum in shared-schemas/src/auth.schema.ts from two providers (google, github) to eleven providers, along with the introduction of a new public type OAuthProvidersSchema. While the PR also includes version bumps in package.json files, these are secondary administrative changes that do not detract from the clarity of the title. The title is specific, concise, and accurately communicates the developer's primary intent without being vague or misleading.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-update-oauth-schema

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

Comment thread package.json
{
"name": "insforge",
"version": "1.1.1",
"version": "1.1.0",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was a mistake while testing cloud compatibility. I revert it to not mess up our versioning.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
shared-schemas/src/auth.schema.ts (1)

57-68: LGTM! OAuth providers expansion looks good.

The addition of 8 new OAuth providers (discord, linkedin, facebook, instagram, tiktok, apple, x, spotify) is well-structured and follows the existing pattern. The enum values are properly lowercase and consistent with the codebase style.

Minor optional suggestion: Consider adding a brief comment above line 57 to clarify that 'x' refers to the platform formerly known as Twitter, for developers who may be unfamiliar with the rebrand.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79d2f5e and 7f4e3ad.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • shared-schemas/package.json (1 hunks)
  • shared-schemas/src/auth.schema.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • shared-schemas/src/auth.schema.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • shared-schemas/src/auth.schema.ts
**/[a-z][a-z0-9-]*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Utility files should use kebab-case or camelCase (kebab-case validated here)

Files:

  • shared-schemas/src/auth.schema.ts
🔇 Additional comments (3)
shared-schemas/src/auth.schema.ts (1)

106-106: LGTM! Type export is consistent.

The new OAuthProvidersSchema type export follows the established pattern and provides proper type inference for the expanded OAuth providers enum.

shared-schemas/package.json (1)

3-3: LGTM! Version bump is appropriate.

The patch version bump from 1.1.2 to 1.1.3 correctly follows semantic versioning for the backwards-compatible addition of new OAuth provider enum values. Existing consumers will not be affected as the change is additive.

package.json (1)

3-3: The version downgrade from 1.1.1 to 1.1.0 is intentional and documented.

The commit message explicitly states "fix version number," indicating this is a deliberate corrective action, not an accidental downgrade. The previous commit updated the version for testing purposes, and this commit corrects it back to the intended 1.1.0 release version. No action required.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
shared-schemas/src/auth.schema.ts (1)

1-1: Revert the root package version downgrade from 1.1.0 back to 1.1.1.

The root package version was downgraded from 1.1.1 to 1.1.0, while shared-schemas was correctly upgraded from 1.1.2 to 1.1.4. This inconsistency is likely unintentional and could break dependent packages. Downgrading production package versions should be avoided unless intentionally reverting a breaking change.

🧹 Nitpick comments (1)
shared-schemas/src/auth.schema.ts (1)

57-69: LGTM! Consider alphabetical ordering for maintainability.

The OAuth providers enum expansion correctly adds support for 11 providers total, aligning with the PR objectives. All provider names are standard and correctly spelled.

For improved maintainability, consider ordering the providers alphabetically:

 export const oAuthProvidersSchema = z.enum([
-  'google',
-  'github',
-  'discord',
-  'linkedin',
-  'facebook',
-  'instagram',
-  'tiktok',
   'apple',
-  'x',
-  'spotify',
+  'discord',
+  'facebook',
+  'github',
+  'instagram',
+  'linkedin',
   'microsoft',
+  'spotify',
+  'tiktok',
+  'x',
+  'google',
 ]);

Wait, let me fix the alphabetical order:

 export const oAuthProvidersSchema = z.enum([
-  'google',
-  'github',
-  'discord',
-  'linkedin',
-  'facebook',
-  'instagram',
-  'tiktok',
   'apple',
-  'x',
-  'spotify',
+  'discord',
+  'facebook',
+  'github',
+  'instagram',
+  'linkedin',
   'microsoft',
+  'spotify',
+  'tiktok',
+  'x',
 ]);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4e3ad and b8502ad.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • shared-schemas/package.json (1 hunks)
  • shared-schemas/src/auth.schema.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • shared-schemas/package.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • shared-schemas/src/auth.schema.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • shared-schemas/src/auth.schema.ts
**/[a-z][a-z0-9-]*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Utility files should use kebab-case or camelCase (kebab-case validated here)

Files:

  • shared-schemas/src/auth.schema.ts
⏰ 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). (2)
  • GitHub Check: CI Pre-merge Check
  • GitHub Check: E2E Tests
🔇 Additional comments (1)
shared-schemas/src/auth.schema.ts (1)

107-107: LGTM!

The new OAuthProvidersSchema type export correctly follows the established pattern of other type exports in the file and enables type-safe usage of OAuth providers throughout the codebase.

@tonychang04 tonychang04 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

very minor compatibility contraints when we don't have the oauth providers endpoints ready yet

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.

2 participants