hackjunction / hackjunction/JunctionApp
Improve copying over data from idToken
- Lenguaje dominante
- JavaScript
- Estrellas
- 78
- Forks
- 69
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Depending on the login method, the user's idToken already potentially contains some relevant information that we could use to pre-fill the registration form. We are currently just using the user's name and email from the idToken, but we could just as well use the following:
- LinkedIn profile URL (if logging in with LinkedIn)
- GitHub profile URL (if logging in with GitHub)
- Something else? (Check what kinds of fields the idToken contains / could contain)
This should be implemented by just making the correct mapping from the idToken value to the respective question in [registration-fields.js](https://github.com/hackjunction/hackplatform/blob/dev/shared/constants/registration-fields.js), see e.g. the following example with the email field for reference:
```
email: {
...FieldProps.email,
category: Categories.basicDetails,
// Here is where we map the values from the idToken
default: (userProfile, idToken) => userProfile.email || idToken.email || '',
validationSchema: required => {
const base = yup
.string()
.email()
.label(FieldProps.email.label);
return required ? base.required() : base;
}
},
```
Guía de contribución
Línea de trabajo
Comienza en shared/constants/registration-fields.js, usando el mapeo predeterminado del campo de correo electrónico como referencia. Inspecciona qué campos puede contener idToken para cada método de inicio de sesión y, después, asigna las URL de perfil compatibles u otros valores útiles a las preguntas de registro correspondientes. El trabajo estará terminado cuando el formulario de registro se complete previamente con los datos disponibles de idToken sin reemplazar los valores existentes de userProfile.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100