Skip to content

Commit

Permalink
Merge pull request #28 from yabid21/dev-4.x
Browse files Browse the repository at this point in the history
[BUGFIX] Fix soft logout and some other issues
  • Loading branch information
yabid21 authored Sep 5, 2023
2 parents 3930c79 + 7a0e63c commit dd15c2c
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Classes/Command/CleanUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ protected function handleUser(array $user): void
$queryBuilder->update($this->tableNames['users'])->set('disable', 1);
break;

// Set deleted flag to 1
// Set deleted flag to 1
case 'delete':
$queryBuilder->update($this->tableNames['users'])->set('deleted', 1);
break;

// Remove record from database
// Remove record from database
case 'deleteIrrevocable':
$queryBuilder->delete($this->tableNames['users']);
break;
Expand Down
4 changes: 3 additions & 1 deletion Classes/LoginProvider/Auth0Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ protected function prepareView(StandaloneView &$standaloneView, PageRenderer &$p
protected function getDefaultView(StandaloneView &$standaloneView, PageRenderer &$pageRenderer): void
{
$standaloneView->setLayoutRootPaths(['EXT:auth0/Resources/Private/Layouts/']);
$templateName = version_compare(GeneralUtility::makeInstance(Typo3Version::class)->getVersion(), '11.0', '>=') ? 'BackendV11' : 'Backend';
$standaloneView->setTemplatePathAndFilename(
GeneralUtility::getFileAbsFileName('EXT:auth0/Resources/Private/Templates/Backend.html')
GeneralUtility::getFileAbsFileName('EXT:auth0/Resources/Private/Templates/' . $templateName . '.html')
);
$standaloneView->assign('error', 'no_typoscript');
$pageRenderer->addCssFile('EXT:auth0/Resources/Public/Styles/backend.css');
Expand All @@ -205,6 +206,7 @@ protected function logoutFromAuth0(): void
{
$redirectUri = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/logout';
if ($this->application->isSingleLogOut() && $this->configuration->isSoftLogout()) {
$this->auth0->clear();
header('Location: ' . $redirectUri);
} else {
header('Location: ' . $this->auth0->logout($this->getCallback($redirectUri)));
Expand Down
8 changes: 4 additions & 4 deletions Classes/Utility/UserUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function insertFeUser(string $tableName, array $user): void
'pid' => $this->configuration->getUserStoragePage(),
'tstamp' => time(),
'username' => $user['email'] ?? $user[$userIdentifier],
'password' => $this->getPassword(),
'password' => $this->getPassword('FE'),
'email' => $user['email'] ?? '',
'crdate' => time(),
'auth0_user_id' => $user[$userIdentifier],
Expand All @@ -129,7 +129,7 @@ public function insertBeUser(string $tableName, array $user): void
'pid' => 0,
'tstamp' => time(),
'username' => $user['email'] ?? $user[$userIdentifier],
'password' => $this->getPassword(),
'password' => $this->getPassword('BE'),
'email' => $user['email'] ?? '',
'crdate' => time(),
'auth0_user_id' => $user[$userIdentifier],
Expand All @@ -155,9 +155,9 @@ protected function getTcaDefaults(string $tableName): array
/**
* @throws InvalidPasswordHashException
*/
protected function getPassword(): string
protected function getPassword(string $mode): string
{
$saltFactory = GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance(TYPO3_MODE);
$saltFactory = GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance($mode);
$password = GeneralUtility::makeInstance(Random::class)->generateRandomHexString(50);

return $saltFactory->getHashedPassword($password);
Expand Down
128 changes: 126 additions & 2 deletions Documentation/About/Changelog/4-0-0.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. include:: ../../Includes.txt

==========================
Version 4.0.0 - 2022/03/03
Version 4.0.0 - 2023/09/01
==========================

This release is a major release, which will likely be breaking.
Expand Down Expand Up @@ -35,6 +35,130 @@ All Changes

This is a list of all changes in this release::

2021-08-04 [TASK] Add possibility to add an anchor to the referrer url (Commit f4ff9745 by Fabian Martin)
2023-08-31 [BUGFIX] Fix no_typoscript error for version 11 (Commit ee9a068 by Yassine Abid)
2023-08-31 [TASK] Fix soft logout (Commit d509179 by Yassine Abid)
2023-08-31 [TASK] Fix cs (Commit 014547d by Yassine Abid)
2023-08-31 [TASK] Require cs fixer on dev environment (Commit 5747ee2 by Yassine Abid)
2022-03-10 Merge pull request #19 from elbebass/4-0-x (Commit 3930c79 by Max Rösch)
2022-03-10 [BUGFIX] ParseFunc must return int instead of real boolean (Commit e006056 by Max Rösch)
2022-03-09 Merge pull request #18 from elbebass/4-0-x (Commit 060f4e7 by Max Rösch)
2022-03-08 [TASK] Get rid of obsolete user model (Commit 0148360 by Max Rösch)
2022-03-08 [WIP] Frontend user updates working - authentication still in progress (Commit 6801b33 by Max Rösch)
2022-03-08 [WIP] Refactoring (Commit 581c31a by Max Rösch)
2022-03-08 [TASK] Remove Auth0Middleware for the moment (Commit 27ca43d by Max Rösch)
2022-03-08 [TASK] Unify naming of extension manager configuration (Commit 773f457 by Max Rösch)
2022-03-08 [TASK] Add correct handling of soft logout process (Commit 220aaed by Max Rösch)
2022-03-08 [TASK] Remove todo after checking code (Commit 13fbbf7 by Max Rösch)
2022-03-08 [BUGFIX] Decode management API response correctly (Commit 34dbd50 by Max Rösch)
2022-03-08 [WIP] Some more small refactoring changes (Commit ae48ee5 by Max Rösch)
2022-03-04 [TASK] Refactor SSL key getter function (Commit b664faa by Max Rösch)
2022-03-04 Merge pull request #17 from elbebass/4-0-x (Commit fe88c2a by Max Rösch)
2022-03-04 [BUGFIX] Add missing bracket resulting from merge conflict (Commit 549121a by Max Rösch)
2022-03-04 Merge pull request #16 from elbebass/4-0-x (Commit 3cdadb2 by Max Rösch)
2022-03-04 Merge branch 'dev-4.x' into 4-0-x (Commit d1364a8 by Max Rösch)
2022-03-03 [TASK] Update library composer json (Commit c5062cf by Max Rösch)
2022-03-03 [WIP] Start documentation while debugging (Commit cf6675f by Max Rösch)
2022-03-03 [TASK] Update and normalize composer json (Commit 5ebe3c4 by Max Rösch)
2022-03-02 [TASK] Move model in cleaner namespace (Commit 8c7396b by Max Rösch)
2022-03-02 [TASK] Update version matrxi (Commit aad81fc by Max Rösch)
2022-02-24 [TASK] Add callback to login action and echo URL for further debugging (Commit f312c8e by Max Rösch)
2022-02-24 [TASK] Add new company code-style and adapt files (Commit 5dc044d by Max Rösch)
2022-02-24 [TASK] Refactor factory class (Commit 80048cd by Max Rösch)
2022-02-24 [TASK] Remove secret_base64_encoded configuration (Commit 0826a2c by Max Rösch)
2022-02-24 [TASK] Refactor factory class and usage (Commit d112ea2 by Max Rösch)
2022-02-24 [TASK] Remove JwtConfiguration class which only provided two constants now (Commit 4678cc1 by Max Rösch)
2022-02-24 [BUGFIX] Remove wrong CSS class from textfield (Commit 785a9d8 by Max Rösch)
2022-02-24 [BUGFIX] Remove wrong CSS class from textfield (Commit 1929b74 by Max Rösch)
2022-02-24 [CODE Codestyle (Commit 6ea3e1d by Max Rösch)
2022-02-24 [WIP] BE user creation and update working (Commit 699b709 by Max Rösch)
2022-02-21 [BUGFIX] Fix backend logout with redirect (Commit ec0f1ee by Max Rösch)
2022-02-21 [WIP] Working but bugs :p (Commit 78d4a45 by Max Rösch)
2022-02-21 [TASK] Remove obsolete fluid count (Commit 9c70191 by Max Rösch)
2022-02-21 [TASK] Disable / remove tests for the moment (Commit f2309b4 by Max Rösch)
2022-02-21 [TASK] Use image viewhelper for Auth0 logo on login view (Commit 97a4380 by Max Rösch)
2022-02-21 [BUGFIX] Fix missing namespace and form select styling for Bootstrap v5 (Commit 3b7a6ac by Max Rösch)
2022-02-18 [WIP] Refactor session handling (Commit 48bdcd9 by Max Rösch)
2022-02-18 [TASK] Update CI file to reflect new php-cs-fixer configuration file name (Commit d23b950 by Max Rösch)
2022-02-18 [CODE] Codestyle (Commit 7285070 by Max Rösch)
2022-02-18 [WIP] Remove old API etc. and introduce basic SDK usage (Commit 978cd04 by Max Rösch)
2022-02-18 [TASK] Move PHP-CS-fixer config file to prefered name (Commit 048f471 by Max Rösch)
2022-02-16 [TASK] Code clean up - parameters etc. (Commit 2312375 by Max Rösch)
2022-02-16 [TASK] Code clean up - parameters etc. (Commit d6008e3 by Max Rösch)
2022-02-16 [TASK] Update icon usage (Commit 35d6416 by Max Rösch)
2022-02-16 [TASK] Use Utils:jsonEncode instead of deprecated method (Commit adefe2f by Max Rösch)
2022-02-16 [TASK] Update language files and add translation (Commit de0d21b by Max Rösch)
2022-02-16 [TASK] Optimize svg icons (Commit 68d4c39 by Max Rösch)
2022-02-16 [TASK] Adapt CI for TYPO3 v10 / v11 with PHP 7.4 / 8.0 (Commit 838bd45 by Max Rösch)
2022-02-16 [TASK] Remove deprecated usage of environmentService (Commit 5da6c90 by Max Rösch)
Yassine Abid@leuchtfeuer-Latitude-1:~/projects/typo3-extensions/dev/auth0-for-typo3$ git log --pretty=format:"%as %s (Commit %h by %aN)"
2023-08-31 [TASK] Remove deprecated TYPO3_MODE (Commit 598aab5 by Yassine Abid)
2023-08-31 [BUGFIX] Fix no_typoscript error for version 11 (Commit ee9a068 by Yassine Abid)
2023-08-31 [TASK] Fix soft logout (Commit d509179 by Yassine Abid)
2023-08-31 [TASK] Fix cs (Commit 014547d by Yassine Abid)
2023-08-31 [TASK] Require cs fixer on dev environment (Commit 5747ee2 by Yassine Abid)
2022-03-10 Merge pull request #19 from elbebass/4-0-x (Commit 3930c79 by Max Rösch)
2022-03-10 [BUGFIX] ParseFunc must return int instead of real boolean (Commit e006056 by Max Rösch)
2022-03-09 Merge pull request #18 from elbebass/4-0-x (Commit 060f4e7 by Max Rösch)
2022-03-08 [TASK] Get rid of obsolete user model (Commit 0148360 by Max Rösch)
2022-03-08 [WIP] Frontend user updates working - authentication still in progress (Commit 6801b33 by Max Rösch)
2022-03-08 [WIP] Refactoring (Commit 581c31a by Max Rösch)
2022-03-08 [TASK] Remove Auth0Middleware for the moment (Commit 27ca43d by Max Rösch)
2022-03-08 [TASK] Unify naming of extension manager configuration (Commit 773f457 by Max Rösch)
2022-03-08 [TASK] Add correct handling of soft logout process (Commit 220aaed by Max Rösch)
2022-03-08 [TASK] Remove todo after checking code (Commit 13fbbf7 by Max Rösch)
2022-03-08 [BUGFIX] Decode management API response correctly (Commit 34dbd50 by Max Rösch)
2022-03-08 [WIP] Some more small refactoring changes (Commit ae48ee5 by Max Rösch)
2022-03-04 [TASK] Refactor SSL key getter function (Commit b664faa by Max Rösch)
2022-03-04 Merge pull request #17 from elbebass/4-0-x (Commit fe88c2a by Max Rösch)
2022-03-04 [BUGFIX] Add missing bracket resulting from merge conflict (Commit 549121a by Max Rösch)
2022-03-04 Merge pull request #16 from elbebass/4-0-x (Commit 3cdadb2 by Max Rösch)
2022-03-04 Merge branch 'dev-4.x' into 4-0-x (Commit d1364a8 by Max Rösch)
2022-03-03 [TASK] Update library composer json (Commit c5062cf by Max Rösch)
2022-03-03 [WIP] Start documentation while debugging (Commit cf6675f by Max Rösch)
2022-03-03 [TASK] Update and normalize composer json (Commit 5ebe3c4 by Max Rösch)
2022-03-02 [TASK] Move model in cleaner namespace (Commit 8c7396b by Max Rösch)
2022-03-02 [TASK] Update version matrxi (Commit aad81fc by Max Rösch)
2022-02-24 [TASK] Add callback to login action and echo URL for further debugging (Commit f312c8e by Max Rösch)
2022-02-24 [TASK] Add new company code-style and adapt files (Commit 5dc044d by Max Rösch)
2022-02-24 [TASK] Refactor factory class (Commit 80048cd by Max Rösch)
2022-02-24 [TASK] Remove secret_base64_encoded configuration (Commit 0826a2c by Max Rösch)
2022-02-24 [TASK] Refactor factory class and usage (Commit d112ea2 by Max Rösch)
2022-02-24 [TASK] Remove JwtConfiguration class which only provided two constants now (Commit 4678cc1 by Max Rösch)
2022-02-24 [BUGFIX] Remove wrong CSS class from textfield (Commit 785a9d8 by Max Rösch)
2022-02-24 [BUGFIX] Remove wrong CSS class from textfield (Commit 1929b74 by Max Rösch)
2022-02-24 [CODE Codestyle (Commit 6ea3e1d by Max Rösch)
2022-02-24 [WIP] BE user creation and update working (Commit 699b709 by Max Rösch)
2022-02-21 [BUGFIX] Fix backend logout with redirect (Commit ec0f1ee by Max Rösch)
2022-02-21 [WIP] Working but bugs :p (Commit 78d4a45 by Max Rösch)
2022-02-21 [TASK] Remove obsolete fluid count (Commit 9c70191 by Max Rösch)
2022-02-21 [TASK] Disable / remove tests for the moment (Commit f2309b4 by Max Rösch)
2022-02-21 [TASK] Use image viewhelper for Auth0 logo on login view (Commit 97a4380 by Max Rösch)
2022-02-21 [BUGFIX] Fix missing namespace and form select styling for Bootstrap v5 (Commit 3b7a6ac by Max Rösch)
2022-02-18 [WIP] Refactor session handling (Commit 48bdcd9 by Max Rösch)
2022-02-18 [TASK] Update CI file to reflect new php-cs-fixer configuration file name (Commit d23b950 by Max Rösch)
2022-02-18 [CODE] Codestyle (Commit 7285070 by Max Rösch)
2022-02-18 [WIP] Remove old API etc. and introduce basic SDK usage (Commit 978cd04 by Max Rösch)
2022-02-18 [TASK] Move PHP-CS-fixer config file to prefered name (Commit 048f471 by Max Rösch)
2022-02-16 [TASK] Code clean up - parameters etc. (Commit 2312375 by Max Rösch)
2022-02-16 [TASK] Code clean up - parameters etc. (Commit d6008e3 by Max Rösch)
2022-02-16 [TASK] Update icon usage (Commit 35d6416 by Max Rösch)
2022-02-16 [TASK] Use Utils:jsonEncode instead of deprecated method (Commit adefe2f by Max Rösch)
2022-02-16 [TASK] Update language files and add translation (Commit de0d21b by Max Rösch)
2022-02-16 [TASK] Optimize svg icons (Commit 68d4c39 by Max Rösch)
2022-02-16 [TASK] Adapt CI for TYPO3 v10 / v11 with PHP 7.4 / 8.0 (Commit 838bd45 by Max Rösch)
2022-02-16 [TASK] Remove deprecated usage of environmentService (Commit 5da6c90 by Max Rösch)
2022-02-16 [TASK] Update composer dependencies and infos (Commit 5d9d318 by Max Rösch)
2022-02-16 [TASK] Add new Bootstrap card class to maintain style (Commit 4dd282d by Max Rösch)
2022-02-16 [TASK] Add Fluid namespaces to template files (Commit 2cd4ba1 by Max Rösch)
2021-09-13 [CODE] Codestyle (Commit 0f179b6 by Max Rösch)
2021-09-13 [TASK] Remove StopActionException and use ResponseInterface (Commit 7605da4 by Max Rösch)
2021-09-10 [TASK] Use TYPO3 version class instead of runtime constants (Commit acc5077 by Max Rösch)
2021-09-10 [TASK] Add new card class to support Bootstrap v5 (Commit ddec423 by Max Rösch)
2021-09-10 [TASK] Remove deprecated TYPO3_MODE constant (Commit 2429a59 by Max Rösch)
2021-08-30 [TASK] Update TER release script (Commit 639a626 by Max Rösch)
2021-08-05 [TASK] Fix language file typos (Commit 2b6336b by Max Rösch)
2021-08-04 [TASK] Add possibility to add an anchor to the referrer url (Commit 6b38ac6 by Max Rösch)
2021-08-03 Merge pull request #9 from Leuchtfeuer/Bugfix (Commit a16fc65 by Max Rösch)
2021-08-02 [BUGFIX] Require autoload only when environment is not in composer mode (Commit 22e2c7a by Fabian Martin)

s
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"config": {
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true
"typo3/class-alias-loader": true,
"php-http/discovery": true
},
"bin-dir": ".Build/bin",
"platform": {
Expand All @@ -74,5 +75,8 @@
"mkdir -p .Build/web/typo3conf/ext/",
"[ -L .Build/web/typo3conf/ext/auth0 ] || ln -snvf ../../../../. .Build/web/typo3conf/ext/auth0"
]
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.14"
}
}

0 comments on commit dd15c2c

Please sign in to comment.