Add Google Sign-In Authentication
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- authentication, backend, database, frontend, security
Línea de trabajo
Start from the login page and the existing email/password auth flow, then check how GOOGLE_CLIENT_ID configuration is read. The work spans GET /api/auth/config, POST /api/auth/google with token verification, an oauth_identities table with a unique provider index, account-deletion cleanup, and the Cross-Origin-Opener-Policy header. Done means a Google sign-in creates or links a user, the button stays hidden without a Client ID, and failures are handled gracefully. This is multi-subsystem design work, so it suits a maintainer more than a first-timer.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Add Google Sign-In to AlphaLearn using Google Identity Services, allowing users to authenticate with their Google accounts instead of relying only on the existing email and password login flow.
Proposed Implementation
Frontend
- Add a Continue with Google button to the login page.
- Display the Google Sign-In option only when
GOOGLE_CLIENT_IDis configured. - Integrate Google Identity Services to obtain the user's ID token.
- Reuse the existing authentication and redirect flow after successful login.
Backend
- Add
GET /api/auth/configto expose the public Google Client ID. - Add
POST /api/auth/googleto verify Google credentials and authenticate users. - Validate the token's signature, issuer, audience, expiration, and verified email claim.
- Link Google identities to existing accounts with the same email address.
- Store Google identity references using a hashed provider identifier rather than storing the raw Google subject.
- Apply rate limiting and handle authentication failures safely.
Database and Security
- Add an
oauth_identitiestable to associate external identities with AlphaLearn users. - Add an index on
user_idand enforce uniqueness for provider identities. - Clean up OAuth identity records when an account is deleted.
- Update the Cross-Origin-Opener-Policy header to support Google popup sign-in.
- Keep OAuth credentials out of source control.
Expected Behavior
- Users can sign in using Google from the login page.
- New users are registered automatically and redirected to the dashboard.
- Existing users can sign in through their linked Google identity.
- Existing accounts with matching email addresses are handled without creating duplicate accounts.
- Google Sign-In remains hidden when no Client ID is configured.
- Authentication failures are handled gracefully.
- Lenguaje dominante
- HTML
- Estrellas
- 3
- Forks
- 29
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
external-issue to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-wallet#733 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
arkavo-org/ArkavoKit#70 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
crowdsecurity/hub#1999 ·
Los mantenedores suelen responder en 1 día