Commit a43a6ca9 authored by jcnventura's avatar jcnventura Committed by Joao Ventura
Browse files

Code cleanup

parent c3cad966
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][].
[Keep a Changelog]: http://keepachangelog.com/
## [Unreleased]
### Added
- Added unit tests for the OpenIDConnectSession class.
- Added unit tests for the OpenIDConnectClaims class.
- Added unit tests for the OpenIDConnectStateToken class.
- Added unit tests for the OpenIDConnectAuthmap class.
### Changed
### Deprecated
### Removed
### Fixed
### Security
[Unreleased]: https://git.drupalcode.org/project/openid_connect/-/compare/8.x-1.0-beta5...8.x-1.x
......@@ -107,8 +107,7 @@ class OpenIDConnectAccountsForm extends FormBase implements ContainerInjectionIn
$container->get('openid_connect.authmap'),
$container->get('openid_connect.claims'),
$container->get('plugin.manager.openid_connect_client.processor'),
$container->get('config.factory'),
$container->get('messenger')
$container->get('config.factory')
);
}
......
......@@ -324,8 +324,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
* {@inheritdoc}
*/
public function decodeIdToken($id_token) {
/* @noinspection PhpUnusedLocalVariableInspection */
list($headerb64, $claims64, $signatureb64) = explode('.', $id_token);
list(, $claims64,) = explode('.', $id_token);
$claims64 = str_replace(['-', '_'], ['+', '/'], $claims64);
$claims64 = base64_decode($claims64);
return json_decode($claims64, TRUE);
......
......@@ -9,11 +9,6 @@ use Drupal\Core\File\FileSystemInterface;
use Drupal\user\UserInterface;
use PHPUnit\Framework\MockObject\MockObject;
const USER_REGISTER_ADMINISTRATORS_ONLY = 'admin_only';
const USER_REGISTER_VISITORS = 'visitors';
const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval';
const FILE_EXISTS_RENAME = FileSystemInterface::EXISTS_RENAME;
/**
* Override the user_password function if it does not exist.
*
......@@ -52,6 +47,5 @@ function file_save_data(
$destination = NULL,
$replace = FileSystemInterface::EXISTS_RENAME
): MockObject {
return $GLOBALS['oldFileMock'];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment