hackjunction / hackjunction/JunctionApp
Improve copying over data from idToken
- 主要言語
- JavaScript
- スター
- 78
- フォーク
- 69
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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;
}
},
```
コントリビューションガイド
調査の方向性
shared/constants/registration-fields.js から始め、メールフィールドのデフォルトマッピングを参照してください。各ログイン方法で idToken に含められるフィールドを調査し、対応しているプロフィール URL やその他の有用な値を対応する登録項目にマッピングしてください。登録フォームが利用可能な idToken データで事前入力され、既存の userProfile の値を置き換えない状態になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100