Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from websharp/bugfix/#167_password_reset_create
Fixes #167
- Loading branch information
Showing
6 changed files
with
164 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Force Login module for Magento2. | ||
* | ||
* (c) bitExpert AG | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace BitExpert\ForceCustomerLogin\Controller; | ||
|
||
use Magento\Framework\App\RequestInterface; | ||
use Magento\Framework\UrlInterface; | ||
|
||
/** | ||
* Class PasswordResetHelper | ||
* @package BitExpert\ForceCustomerLogin\Controller | ||
*/ | ||
class PasswordResetHelper | ||
{ | ||
const CREATE_PASSWORD_DIRECT_URL_SCHEME = '/customer/account/createpassword/\?.*token='; | ||
|
||
/** | ||
* @param UrlInterface $url | ||
* @param RequestInterface $request | ||
* @return bool | ||
*/ | ||
public function processDirectCreatePasswordRequest(UrlInterface $urlInstance, RequestInterface $request) | ||
{ | ||
$url = $urlInstance->getCurrentUrl(); | ||
|
||
// Explicit behaviour for special urls | ||
if (preg_match( | ||
sprintf( | ||
'#^.*%s.*$#i', | ||
self::CREATE_PASSWORD_DIRECT_URL_SCHEME | ||
), | ||
$url | ||
) === 1) { | ||
$params = $request->getParams(); | ||
unset($params['token']); | ||
$request->setParams($params); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters