Skip to content

Fill DEV profile fields with MLH info on signup - #23677

Merged
benhalpern merged 2 commits into
mainfrom
feat/prefill-mlh-profile
Jul 28, 2026
Merged

Fill DEV profile fields with MLH info on signup#23677
benhalpern merged 2 commits into
mainfrom
feat/prefill-mlh-profile

Conversation

@pmvenegas

@pmvenegas pmvenegas commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This change prefills user profile data from MLH when an identity is linked, i.e. on OAuth registration. Specifically,

  1. Since MLH does not provide a nickname, the suggested username is derived from the local-part of the user's email address. Previously, a random string was generated since the username was blank.
  2. The scopes user:read:education, user:read:employment, and user:read:address are added to the MLH OAuth strategy, since these correspond to profile data we can use.
  3. After an identity is created in Authentication::Authenticator#call, an worker is enqueued that:
    • fetches the user profile data with expansions from the MLH API
    • maps MLH fields to Forem profile fields (currently only location), with support for ProfileFields looked up by label: Work, Education, and Pronouns, if configured on the Forem instance.
    • fills in the corresponding fields if they are unassigned

Related Tickets & Documents

DEV-3339 (Jira)

QA Instructions, Screenshots, Recordings

This can be tested by creating a new Forem account with the MLH provider and confirming that profile fields set in MyMLH are used on Forem. MyMLH should prompt the user to enter data for the requested scopes if not already filled.

UI accessibility checklist

N/A

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

None


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@pmvenegas
pmvenegas requested review from a team as code owners July 27, 2026 18:04
@pmvenegas
pmvenegas force-pushed the feat/prefill-mlh-profile branch from 8ac7024 to 6eddfca Compare July 27, 2026 18:09
uid: "123456",
info: {
email: "test@example.com",
nickname: "mlhuser",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed to reflect actual MLH behavior.

@pmvenegas
pmvenegas force-pushed the feat/prefill-mlh-profile branch from 6eddfca to f76701a Compare July 27, 2026 18:29
@pmvenegas pmvenegas changed the title Feat/prefill mlh profile Fill DEV profile fields with MLH info on signup Jul 27, 2026

@benhalpern benhalpern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@benhalpern
benhalpern merged commit b4a2bc3 into main Jul 28, 2026
20 checks passed
@benhalpern
benhalpern deleted the feat/prefill-mlh-profile branch July 28, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants