hackjunction / hackjunction/JunctionApp
Improve copying over data from idToken
- Vorherrschende Sprache
- JavaScript
- Sterne
- 78
- Forks
- 69
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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;
}
},
```
Beitragsleitfaden
Rechercherichtung
Start in shared/constants/registration-fields.js, using the email field's default mapping as the reference. Inspect which fields the idToken can contain for each login method, then map supported profile URLs or other useful values to the corresponding registration questions. Done means the registration form is pre-filled with the available idToken data without replacing existing userProfile values.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100