Skip to content

feat: add Google sign-up option to Console#3104

Open
darkspirit2802 wants to merge 2 commits into
appwrite:mainfrom
darkspirit2802:feat/google-oauth-signup
Open

feat: add Google sign-up option to Console#3104
darkspirit2802 wants to merge 2 commits into
appwrite:mainfrom
darkspirit2802:feat/google-oauth-signup

Conversation

@darkspirit2802

@darkspirit2802 darkspirit2802 commented Jul 2, 2026

Copy link
Copy Markdown

What this PR does

Adds a "Sign up with Google" option to the Console sign-up page, alongside the existing GitHub OAuth option.
Adds a "Sign in with Google" option to the Console sign-in page, alongside the existing GitHub OAuth option.

Changes

  • Added onGoogleLogin() handler using the existing OAuthProvider.Google provider from the SDK
  • Added a new "Sign up with Google" button, following the same pattern as the existing GitHub button
  • Added a new "Sign in with Google" button, following the same pattern as the existing GitHub button

Testing

Tested locally against a self-hosted Appwrite instance with PUBLIC_CONSOLE_MODE=cloud set temporarily to verify rendering. Both buttons render correctly and trigger their respective OAuth flows. Google OAuth provider wasn't configured in my local test project, so the full redirect wasn't exercised end-to-end, but the button correctly calls createOAuth2Session with the Google provider.

Closes appwrite/appwrite#12777

Screenshot 2026-07-03 034151 Screenshot 2026-07-03 041840

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds "Sign in/up with Google" buttons to both the login and register pages, mirroring the existing GitHub OAuth pattern exactly (same URL-handling logic, same button structure, same createOAuth2Session call with Google-appropriate scopes).

  • Login page (/login): adds onGoogleLogin() copied from onGithubLogin(), replaces the old bare <div style:margin-bottom> wrapper with <Layout.Stack gap="s"> for consistent spacing between both OAuth buttons.
  • Register page (/register): adds onGoogleLogin() copied from onGithubLogin(), places the Google button in a nested <div style:margin-top> inside the existing outer <div style:margin-bottom> wrapper — inconsistent with the cleaner Layout.Stack approach used on the login page.
  • bun.lock: adds integrity checksums to several previously unchecked private @appwrite.io packages — a minor supply-chain improvement with no functional impact.

Confidence Score: 5/5

Safe to merge — the Google OAuth handlers are faithful copies of the existing GitHub handlers with no new logic.

Both new onGoogleLogin() functions mirror their onGithubLogin() counterparts exactly: same URL construction, same createOAuth2Session call structure, only the provider enum and OAuth scopes differ. No new redirect logic, no new state management, and no new API surface was introduced.

No files require special attention beyond the known spacing inconsistency in the register page already flagged in prior review threads.

Important Files Changed

Filename Overview
src/routes/(public)/(guest)/login/+page.svelte Adds Google OAuth handler and button; replaces old bare div with Layout.Stack for correct spacing of both OAuth buttons.
src/routes/(public)/(guest)/register/+page.svelte Adds Google OAuth handler and button using a raw nested div with inline margin-top, inconsistent with the Layout.Stack approach used on the login page.
bun.lock Adds integrity hash strings to previously unverified private @appwrite.io packages — supply-chain improvement, no functional change.

Reviews (2): Last reviewed commit: "feat: add Google sign-in option to login..." | Re-trigger Greptile

</Button>
<div style:margin-top="var(--gap-s, 8px)">
<Button secondary fullWidth on:click={onGoogleLogin} {disabled}>
<span class="icon-google" aria-hidden="true"></span>

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.

P1 icon-google class has no prior usage in the codebase

Every other OAuth icon (icon-github) appears in five files, but icon-google is introduced here for the first time. The icon CSS is loaded globally from @appwrite.io/pink-icons via +layout.ts. If this class is not defined in the currently-pinned version of that package (0.25.0), the button renders with no icon — a silently broken UI. Since node_modules are not committed and the package is sourced from a private registry, the class availability cannot be verified from the diff alone. Please confirm icon-google is exported by @appwrite.io/pink-icons@0.25.0 before merging.

Comment on lines +124 to +139
function onGoogleLogin() {
let successUrl = window.location.origin;

if (page.url.searchParams.has('code')) {
successUrl += `?code=${page.url.searchParams.get('code')}`;
} else if (page.url.searchParams.has('campaign')) {
successUrl += `?campaign=${page.url.searchParams.get('campaign')}`;
}

sdk.forConsole.account.createOAuth2Session({
provider: OAuthProvider.Google,
success: successUrl,
failure: window.location.origin,
scopes: ['profile', 'email']
});
}

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.

P2 Google OAuth is missing from the sign-in page

The login page (/login) only offers GitHub OAuth, so a user who registers with Google will find no matching sign-in option on the login page and will likely be confused or stranded. If the intent is to ship both pages together, the corresponding onGoogleLogin() handler and button need to be added to src/routes/(public)/(guest)/login/+page.svelte as well.

Comment on lines +157 to +162
<div style:margin-top="var(--gap-s, 8px)">
<Button secondary fullWidth on:click={onGoogleLogin} {disabled}>
<span class="icon-google" aria-hidden="true"></span>
<span class="text">Sign up with Google</span>
</Button>
</div>

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.

P2 Spacing via nested div instead of Layout.Stack

The PR description says "Wrapped both OAuth buttons in a Layout.Stack for consistent spacing," but the implementation uses a raw <div style:margin-top> instead. Layout.Stack is already imported and used on this page (wrapping the full form), so a gap-based stack would be cleaner and consistent with the design system's intent. A <div> with an inline style bypasses the design token system and adds nesting that isn't necessary.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Add "Continue with Google" as a sign-up and sign-in option

1 participant