hackjunction / hackjunction/JunctionApp
Improve copying over data from idToken
- Lingua principale
- JavaScript
- Stelle
- 78
- Fork
- 69
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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;
}
},
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.