Follow up from #3007441: Use new authentication and scope

Leftover email-based code (UserManager::getUserByEmail(), userExists()) and outdated scope docs should be removed.

Issue fork strava-3611131

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

markconroy created an issue. See original summary.

markconroy’s picture

f0ns made their first commit to this issue’s fork.

f0ns’s picture

Version: 2.x-dev » 3.0.x-dev

f0ns changed the visibility of the branch 3611131-remove-redundant-email-code to hidden.

f0ns’s picture

Status: Active » Needs review

Cleaned up this code.

  • f0ns committed e2547fee on 3.0.x
    Issue #3611131: Remove the dead email-based user registration code
    
f0ns’s picture

The MR (targeting 3.0.x) removes all leftover email-based code that stopped working when Strava's OAuth dropped access to the athlete's email address (#3007441):

  • UserManager::getUserByEmail() and AthleteUserHandler::userExists(): no remaining callers.
  • The dead registration chain: AthleteUserHandler::userCreate(), UserManager::registerUser() and its helpers (unique username generation, user picture download, registration checks). Their only caller was already commented out.
  • The now-unused strava.user_manager service dependencies and the drupal:file dependency, which only existed for the user picture download.
  • Outdated pre-2018 scope docs (public, write, view_private) in Strava.php.

Note for the release notes: this removes public methods, so custom code calling them will break (acceptable while 3.0.x is in alpha).

Follow-up needed

While verifying the removals I found a pre-existing gap (not caused by this MR): when a logged-in user authorizes Strava for the first time, AthleteUserHandler::connect() never creates the athlete entity: that branch has been commented out since #3007441. Creating a Drupal user for anonymous visitors is genuinely blocked by the missing email, but creating an athlete entity for an already-authenticated user needs no email: AthleteManager::createAthlete() still exists and has everything it needs. This deserves a follow-up issue to wire that up so first-time linking works end to end.

f0ns’s picture

Status: Needs review » Fixed

Created separate issue for the follow-up.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.