Skip to content

refactor(google-auth): introduce helper for iOS client ID URL scheme conversion#17

Merged
sbaiahmed1 merged 1 commit intomainfrom
fix/issues-13
Jan 13, 2026
Merged

refactor(google-auth): introduce helper for iOS client ID URL scheme conversion#17
sbaiahmed1 merged 1 commit intomainfrom
fix/issues-13

Conversation

@sbaiahmed1
Copy link
Copy Markdown
Owner

@sbaiahmed1 sbaiahmed1 commented Jan 13, 2026

resolves: #13

  • Added getUrlSchemeFromClientId to simplify and standardize URL scheme creation.
  • Updated iOS configuration logic to use the new helper function.
  • Included a new lint:fix script in package.json for automated linting fixes.

Summary by CodeRabbit

  • Chores

    • Added a new development script for automatic code formatting assistance during the linting process.
  • Bug Fixes

    • Enhanced the iOS Google Authentication URL scheme derivation logic for improved accuracy and reliability when authenticating with Google credentials.

✏️ Tip: You can customize this high-level summary in your review settings.

…conversion

- Added `getUrlSchemeFromClientId` to simplify and standardize URL scheme creation.
- Updated iOS configuration logic to use the new helper function.
- Included a new `lint:fix` script in package.json for automated linting fixes.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

This pull request adds an ESLint auto-fix script to package.json and introduces a new helper function in the auth plugin to properly derive iOS URL schemes from Google client IDs by reversing dotted segments, replacing a simpler split-based heuristic.

Changes

Cohort / File(s) Summary
Build Configuration
package.json
Added new lint:fix npm script to run ESLint with --fix flag for automatic code corrections on JS/TS/TSX files
Auth Plugin Logic
plugin/src/withGoogleAuth.ts
Introduced internal helper getUrlSchemeFromClientId() to properly reverse dotted segments from iOS Google client IDs; refactored withGoogleAuthIOS and withGoogleUrlScheme to use the new helper instead of simple split('.') heuristic

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A script to fix what linting found,
And URL schemes now properly bound—
Reversing dots with careful care,
iOS Google auth now works fair! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing a helper function for iOS client ID URL scheme conversion, which directly addresses the PR's primary objective.
Linked Issues check ✅ Passed The changes directly address issue #13 by replacing the flawed split('.')[0] heuristic with getUrlSchemeFromClientId() that properly reverses the client ID segments to create the correct iOS URL scheme.
Out of Scope Changes check ✅ Passed The lint:fix script addition is a minor, standard development tool enhancement that reasonably supports code quality maintenance for the project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f221db4 and 74d324e.

📒 Files selected for processing (2)
  • package.json
  • plugin/src/withGoogleAuth.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). (1)
  • GitHub Check: build-ios
🔇 Additional comments (4)
package.json (1)

41-42: LGTM!

The lint:fix script follows the same pattern as the existing lint script and provides a convenient way to auto-fix linting issues.

plugin/src/withGoogleAuth.ts (3)

141-148: LGTM! Correct URL scheme derivation.

The helper properly reverses the client ID segments to produce the standard iOS URL scheme format (e.g., com.googleusercontent.apps.123456789). This correctly addresses Issue #13 where the previous .split('.')[0] heuristic was embedding only the numeric prefix instead of the full reversed scheme.


188-195: LGTM!

The usage is safe here since iosClientId is guaranteed to be truthy within the if (iosClientId) block (line 183). The override pattern with options.iosUrlScheme is preserved, and the existing duplicate prevention logic remains intact.


272-283: LGTM!

The ternary correctly handles the case where options.iosClientId may be undefined, and the if (urlScheme) guard on line 278 ensures no action is taken for null/empty values.


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 and usage tips.

@sbaiahmed1 sbaiahmed1 merged commit 9e1a85a into main Jan 13, 2026
6 checks passed
@sbaiahmed1 sbaiahmed1 deleted the fix/issues-13 branch January 13, 2026 21:52
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.

[Expo] [IOS] App crashes with default configuration

1 participant