Repository navigation
[Chore] Update oauth schema to support more OAuth providers - #452
Conversation
WalkthroughRoot package version changed from 1.1.1 to 1.1.0; Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
| { | ||
| "name": "insforge", | ||
| "version": "1.1.1", | ||
| "version": "1.1.0", |
There was a problem hiding this comment.
This was a mistake while testing cloud compatibility. I revert it to not mess up our versioning.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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
OAuthProvidersSchematype 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.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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
OAuthProvidersSchematype export correctly follows the established pattern of other type exports in the file and enables type-safe usage of OAuth providers throughout the codebase.
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
Chores