hackjunction / hackjunction/JunctionApp

Improve copying over data from idToken

Open
#27 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
78
Forks
69
PR merge metrics
No merged PRs in 30d

Description

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;
}
},
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.