Skip to content

feat: add Google One Tap modal #1117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

darcyYe
Copy link
Contributor

@darcyYe darcyYe commented May 27, 2025

Summary

add Google One Tap modal, resolves LOG-11503

@darcyYe darcyYe requested review from a team and Copilot May 27, 2025 03:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a Google One Tap modal to the documentation site by integrating a new configuration fetch and rendering mechanism in the Layout wrapper. Key changes include introducing a zod schema for config validation, caching of the fetched configuration, and updating the Docusaurus configuration to include the Google One Tap script and API base URL custom field.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/theme/Layout/index.tsx Adds LayoutWrapper component for fetching and rendering Google One Tap modal.
package.json Adds the "zod" dependency used for runtime config validation.
docusaurus.config.ts Injects the Google One Tap client script and adds a custom field for the API base URL.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported


setConfig(validatedConfig);
} catch (error) {
console.error('Error fetching or validating Google One Tap config:', error);
Copy link
Preview

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Consider implementing a graceful fallback UI or user notification in case the config fetch fails rather than only logging the error.

Suggested change
console.error('Error fetching or validating Google One Tap config:', error);
console.error('Error fetching or validating Google One Tap config:', error);
setFetchError(true);

Copilot uses AI. Check for mistakes.

id="g_id_onload"
data-client_id={config.clientId}
// TODO: implement handleCredentialResponse page
data-callback="handleCredentialResponse"
Copy link
Preview

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding documentation or clarifying the TODO for the 'handleCredentialResponse' callback to guide future implementations.

Copilot uses AI. Check for mistakes.

Copy link

cloudflare-workers-and-pages bot commented May 27, 2025

Deploying logto-docs-tutorials with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b9f070
Status: ✅  Deploy successful!
Preview URL: https://5dd7f505.logto-docs-tutorials.pages.dev
Branch Preview URL: https://yemq-add-local-google-one-ta.logto-docs-tutorials.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented May 27, 2025

Deploying logto-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b9f070
Status: ✅  Deploy successful!
Preview URL: https://fc4cc63e.logto-docs.pages.dev
Branch Preview URL: https://yemq-add-local-google-one-ta.logto-docs.pages.dev

View logs

@darcyYe darcyYe marked this pull request as ready for review May 29, 2025 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant