Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
There was a problem hiding this comment.
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.jsandLoginOrRegister2.jscomponents 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 }); |
There was a problem hiding this comment.
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 } }).
| if (!authUrl) { | ||
| console.error("NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
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.
| if (!authUrl) { | ||
| console.error("NEXT_PUBLIC_REACT_APP_AUTH_URL is not configured"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
| - Enable Google+ API or Google Identity services | |
| - Enable Google Identity Services (OAuth 2.0) |
| }, []); | ||
|
|
||
| const handleSlackLoginClick = () => { | ||
| trackEvent("login_slack", { current_page: window.location.pathname }); |
There was a problem hiding this comment.
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 } }).
| }; | ||
|
|
||
| const handleSignupClick = () => { | ||
| trackEvent("signup_slack", { current_page: window.location.pathname }); |
There was a problem hiding this comment.
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 } }).
| }, []); | ||
|
|
||
| const handleSlackLoginClick = () => { | ||
| trackEvent("login_slack", { current_page: window.location.pathname }); |
There was a problem hiding this comment.
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 } }).
| export default function LoginOrRegister({ introText, previousPage }) { | ||
| const { isLoggedIn, user } = useAuthInfo(); | ||
| const { redirectToLoginPage } = useRedirectFunctions(); | ||
| const { isLoggedIn, user } = useAuthInfo(); |
There was a problem hiding this comment.
Unused variable isLoggedIn.
| const { isLoggedIn, user } = useAuthInfo(); | |
| const { user } = useAuthInfo(); |
| </Stack> | ||
| ); | ||
| } else { | ||
| const { isLoggedIn, user } = useAuthInfo(); |
There was a problem hiding this comment.
Unused variable isLoggedIn.
| const { isLoggedIn, user } = useAuthInfo(); | |
| const { user } = useAuthInfo(); |
| ); | ||
| } else { | ||
| const { isLoggedIn, user } = useAuthInfo(); | ||
| const { redirectToLoginPage } = useRedirectFunctions(); |
There was a problem hiding this comment.
Unused variable redirectToLoginPage.
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
handleGoogleLoginClick()to bothLoginOrRegistercomponents, redirects to${authUrl}/google/loginNEXT_PUBLIC_REACT_APP_AUTH_URLto prevent undefined redirectslogin_googleanalytics event trackingUI
Documentation
docs/GoogleLoginSetup.mdwith PropelAuth and Google Cloud Console configuration stepsenv_templatewith auth-related environment variablesConfiguration Required
PropelAuth dashboard configuration needed before deployment:
https://auth.ohack.dev/google/callbackSee
docs/GoogleLoginSetup.mdfor detailed setup.Example Usage
Testing
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/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
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.