Skip to content

Add Google OAuth login via PropelAuth#240

Merged
gregv merged 4 commits intodevelopfrom
copilot/add-google-login-propelauth
Feb 14, 2026
Merged

Add Google OAuth login via PropelAuth#240
gregv merged 4 commits intodevelopfrom
copilot/add-google-login-propelauth

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Adds Google as a second authentication provider alongside existing Slack login. Users can now authenticate with either provider through PropelAuth's unified auth flow.

Changes

Authentication

  • Added handleGoogleLoginClick() to both LoginOrRegister components, redirects to ${authUrl}/google/login
  • Added environment variable validation for NEXT_PUBLIC_REACT_APP_AUTH_URL to prevent undefined redirects
  • Added login_google analytics event tracking

UI

  • Updated login components to present both Google and Slack options with clear labels
  • Standardized divider text and improved visual hierarchy
  • Removed unused Facebook Pixel configuration variables

Documentation

  • Created docs/GoogleLoginSetup.md with PropelAuth and Google Cloud Console configuration steps
  • Updated env_template with auth-related environment variables
  • Added authentication overview to README

Configuration Required

PropelAuth dashboard configuration needed before deployment:

  1. Enable Google OAuth provider
  2. Add Google Cloud Console OAuth credentials
  3. Configure authorized redirect URI: https://auth.ohack.dev/google/callback

See docs/GoogleLoginSetup.md for detailed setup.

Example Usage

// Google login
const handleGoogleLoginClick = () => {
  const authUrl = process.env.NEXT_PUBLIC_REACT_APP_AUTH_URL;
  
  if (!authUrl) {
    console.error("NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured");
    return;
  }
  
  window.location.href = `${authUrl}/google/login`;
};

// Slack login (unchanged)
const handleSlackLoginClick = () => {
  const authUrl = process.env.NEXT_PUBLIC_REACT_APP_AUTH_URL;
  const slackTeamId = process.env.NEXT_PUBLIC_SLACK_TEAM_ID || "T1Q7936BH";
  window.location.href = `${authUrl}/slack/login?external_param_team=${slackTeamId}`;
};

Testing

  • CodeQL: 0 vulnerabilities
  • Jest: 51 tests passing
  • Fully backward compatible with existing Slack authentication

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.propelauth.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Google login via propelauth </issue_title>
<issue_description>Thinking about the best practices with propel auth. We already have slack login. I would like to add the ability to log in with Google as well. Please make all changes as a senior software engineer after you think about it step by step </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Contributor

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend-ohack-dev Ready Ready Preview Feb 1, 2026 0:47am

Request Review

Copilot AI and others added 2 commits February 1, 2026 00:43
Co-authored-by: gregv <6913307+gregv@users.noreply.github.com>
Co-authored-by: gregv <6913307+gregv@users.noreply.github.com>
Co-authored-by: gregv <6913307+gregv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Google login via PropelAuth Add Google OAuth login via PropelAuth Feb 1, 2026
Copilot AI requested a review from gregv February 1, 2026 00:49
@gregv gregv requested a review from Copilot February 1, 2026 02:05
Copy link
Contributor

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 Google OAuth as a second authentication provider alongside the existing Slack login, implementing a unified authentication flow through PropelAuth. The implementation provides users with a choice between Google and Slack authentication methods.

Changes:

  • Added Google login functionality to both LoginOrRegister.js and LoginOrRegister2.js components with corresponding UI updates
  • Added environment variable validation and analytics tracking for the new Google login flow
  • Created comprehensive documentation for PropelAuth and Google Cloud Console configuration
  • Updated environment template and README with authentication information

Reviewed changes

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

Show a summary per file
File Description
src/components/LoginOrRegister/LoginOrRegister2.js Added Google login handler, updated UI to show both login options, added analytics tracking
src/components/LoginOrRegister/LoginOrRegister.js Added Google login handler for legacy component, updated UI similarly
env_template Added required PropelAuth auth URL and optional Slack team ID environment variables
docs/GoogleLoginSetup.md Created comprehensive setup guide for PropelAuth and Google OAuth configuration
README.md Added authentication overview with link to setup documentation

trackEvent('signup_slack', { current_page: window.location.pathname });
};
const handleSignupClick = () => {
trackEvent("signup_slack", { current_page: window.location.pathname });
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The trackEvent function expects an object parameter with action and params properties, not two positional arguments. The current call trackEvent("signup_slack", { current_page: window.location.pathname }) will not work correctly because the function signature is trackEvent({ action, params = {} }). This should be changed to trackEvent({ action: "signup_slack", params: { current_page: window.location.pathname } }).

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +38
if (!authUrl) {
console.error("NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured");
return;
}
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The error handling only logs to the console when NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured. Consider providing user-facing feedback (e.g., displaying an Alert or notification) to inform users that authentication is temporarily unavailable. This would improve the user experience by making the issue visible rather than silently failing.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +52
if (!authUrl) {
console.error("NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured");
return;
}
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The error handling only logs to the console when NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured. Consider providing user-facing feedback (e.g., displaying an Alert or notification) to inform users that authentication is temporarily unavailable. This would improve the user experience by making the issue visible rather than silently failing.

Copilot uses AI. Check for mistakes.
4. **Configure Google Cloud Console** (if not already done)
- Go to [Google Cloud Console](https://console.cloud.google.com/)
- Create a new project or use existing one
- Enable Google+ API or Google Identity services
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The reference to "Google+ API" is outdated. Google+ was shut down in 2019. For Google OAuth 2.0 authentication, you should enable "Google Identity Services" or "Google Sign-In API" instead. Update this line to reflect the current Google authentication APIs.

Suggested change
- Enable Google+ API or Google Identity services
- Enable Google Identity Services (OAuth 2.0)

Copilot uses AI. Check for mistakes.
}, []);

const handleSlackLoginClick = () => {
trackEvent("login_slack", { current_page: window.location.pathname });
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The trackEvent function expects an object parameter with action and params properties, not two positional arguments. The current call trackEvent("login_slack", { current_page: window.location.pathname }) will not work correctly because the function signature is trackEvent({ action, params = {} }). This should be changed to trackEvent({ action: "login_slack", params: { current_page: window.location.pathname } }).

Copilot uses AI. Check for mistakes.
};

const handleSignupClick = () => {
trackEvent("signup_slack", { current_page: window.location.pathname });
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The trackEvent function expects an object parameter with action and params properties, not two positional arguments. The current call trackEvent("signup_slack", { current_page: window.location.pathname }) will not work correctly because the function signature is trackEvent({ action, params = {} }). This should be changed to trackEvent({ action: "signup_slack", params: { current_page: window.location.pathname } }).

Copilot uses AI. Check for mistakes.
}, []);

const handleSlackLoginClick = () => {
trackEvent("login_slack", { current_page: window.location.pathname });
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The trackEvent function expects an object parameter with action and params properties, not two positional arguments. The current call trackEvent("login_slack", { current_page: window.location.pathname }) will not work correctly because the function signature is trackEvent({ action, params = {} }). This should be changed to trackEvent({ action: "login_slack", params: { current_page: window.location.pathname } }).

Copilot uses AI. Check for mistakes.
export default function LoginOrRegister({ introText, previousPage }) {
const { isLoggedIn, user } = useAuthInfo();
const { redirectToLoginPage } = useRedirectFunctions();
const { isLoggedIn, user } = useAuthInfo();
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Unused variable isLoggedIn.

Suggested change
const { isLoggedIn, user } = useAuthInfo();
const { user } = useAuthInfo();

Copilot uses AI. Check for mistakes.
</Stack>
);
} else {
const { isLoggedIn, user } = useAuthInfo();
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Unused variable isLoggedIn.

Suggested change
const { isLoggedIn, user } = useAuthInfo();
const { user } = useAuthInfo();

Copilot uses AI. Check for mistakes.
);
} else {
const { isLoggedIn, user } = useAuthInfo();
const { redirectToLoginPage } = useRedirectFunctions();
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Unused variable redirectToLoginPage.

Copilot uses AI. Check for mistakes.
@gregv gregv merged commit 56497da into develop Feb 14, 2026
7 checks passed
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 Google login via propelauth

2 participants