@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow "bin/auth recover" to succeed before phabricator.base-uri is set

Summary:
Fixes T4132. If you run "bin/auth recover" before setting the base URI, it throws when trying to generate a production URI.

Instead, just show the path. We can't figure out the domain, and I think this is less confusing than showing "your.phabricator.example.com", etc.

Test Plan: Ran `bin/auth recover <user>` for valid and missing base-uri.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4132

Differential Revision: https://secure.phabricator.com/D7615

+13 -2
+2 -1
src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
··· 72 72 $console = PhutilConsole::getConsole(); 73 73 $console->writeOut( 74 74 pht( 75 - 'Use this link to recover access to the "%s" account:', 75 + 'Use this link to recover access to the "%s" account from the web '. 76 + 'interface:', 76 77 $username)); 77 78 $console->writeOut("\n\n"); 78 79 $console->writeOut(" %s", $user->getEmailLoginURI());
+11 -1
src/applications/people/storage/PhabricatorUser.php
··· 495 495 } 496 496 } 497 497 $token = $this->generateEmailToken($email); 498 - $uri = PhabricatorEnv::getProductionURI('/login/etoken/'.$token.'/'); 498 + 499 + $uri = '/login/etoken/'.$token.'/'; 500 + try { 501 + $uri = PhabricatorEnv::getProductionURI($uri); 502 + } catch (Exception $ex) { 503 + // If a user runs `bin/auth recover` before configuring the base URI, 504 + // just show the path. We don't have any way to figure out the domain. 505 + // See T4132. 506 + } 507 + 499 508 $uri = new PhutilURI($uri); 509 + 500 510 return $uri->alter('email', $email->getAddress()); 501 511 } 502 512