mirror of
https://github.com/a2nt/silverstripe-progressivewebapp.git
synced 2024-10-22 11:05:45 +02:00
IMPR: add change password URL. Ref: https://web.dev/change-password-url/
This commit is contained in:
parent
ec57485d4e
commit
b9c982bd08
@ -6,6 +6,7 @@ SilverStripe\Control\Director:
|
|||||||
rules:
|
rules:
|
||||||
'manifest.json': 'A2nt\ProgressiveWebApp\Controllers\ManifestController'
|
'manifest.json': 'A2nt\ProgressiveWebApp\Controllers\ManifestController'
|
||||||
'sw.js/$Action': 'A2nt\ProgressiveWebApp\Controllers\ServiceWorkerController'
|
'sw.js/$Action': 'A2nt\ProgressiveWebApp\Controllers\ServiceWorkerController'
|
||||||
|
'.well-known/$Action!': 'A2nt\ProgressiveWebApp\Controllers\WellKnownController'
|
||||||
|
|
||||||
SilverStripe\CMS\Model\SiteTree:
|
SilverStripe\CMS\Model\SiteTree:
|
||||||
extensions:
|
extensions:
|
||||||
|
@ -16,9 +16,8 @@ class ManifestController extends Controller
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private static $allowed_actions = [
|
private static $allowed_actions = [
|
||||||
'index'
|
'index',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default controller action for the manifest.json file
|
* Default controller action for the manifest.json file
|
||||||
*
|
*
|
||||||
|
35
src/Controllers/WellKnownController.php
Normal file
35
src/Controllers/WellKnownController.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace A2nt\ProgressiveWebApp\Controllers;
|
||||||
|
|
||||||
|
use SilverStripe\Control\Controller;
|
||||||
|
use SilverStripe\Control\Director;
|
||||||
|
use SilverStripe\Security\Security;
|
||||||
|
|
||||||
|
class WellKnownController extends Controller
|
||||||
|
{
|
||||||
|
private static $allowed_actions = [
|
||||||
|
'index',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$req = $this->getRequest();
|
||||||
|
$action = $req->param('Action');
|
||||||
|
switch($action) {
|
||||||
|
case 'change-password':
|
||||||
|
return $this->changepassword();
|
||||||
|
default:
|
||||||
|
return $this->httpError(404, 'Not found');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function changepassword()
|
||||||
|
{
|
||||||
|
return $this->redirect(
|
||||||
|
Director::absoluteURL(
|
||||||
|
Security::singleton()->Link('changepassword')
|
||||||
|
), 303
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user