Skip to content

Commit

Permalink
Update on comments and import
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Riedmüller committed May 17, 2024
1 parent cb34065 commit c7bdee0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions includes/AuthGuardianProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Config;
use ConfigFactory;
use Exception;
use MediaWiki\MainConfigNames;
use MediaWiki\Permissions\GrantsInfo;
use MediaWiki\Session\SessionBackend;
Expand Down Expand Up @@ -34,7 +35,7 @@ public function __construct( UserFactory $userFactory, ConfigFactory $configFact

/**
* @inheritDoc
* @throws \Exception
* @throws Exception
*/
public function provideSessionInfo( WebRequest $request ) {
// Do nothing if not in the REST API
Expand All @@ -48,7 +49,6 @@ public function provideSessionInfo( WebRequest $request ) {
return null;
}

// Do nothing if there is a valid session
$prefix = $this->getConfig()->get( MainConfigNames::CookiePrefix );
$sessionId = $request->getCookie( '_session', $prefix );

Expand All @@ -57,7 +57,7 @@ public function provideSessionInfo( WebRequest $request ) {
return null;
}

// Compare tokens
// Compare tokens; do nothing if they don't match
$guardianToken = $this->daConfig->get( 'GuardianToken' );
if ( $authToken !== $guardianToken ) {
return null;
Expand All @@ -80,6 +80,8 @@ public function provideSessionInfo( WebRequest $request ) {
}

/**
* @param WebRequest $request
*
* @return string|null
*/
private function getBearerToken( WebRequest $request ): ?string {
Expand Down

0 comments on commit c7bdee0

Please sign in to comment.