mirror of
https://github.com/humhub/humhub.git
synced 2025-02-12 03:26:25 +01:00
Fix: Script nonce not working on first request
This commit is contained in:
parent
29aab58604
commit
250ccfe533
@ -23,7 +23,7 @@ use humhub\modules\web\security\helpers\Security;
|
||||
*/
|
||||
class Events
|
||||
{
|
||||
public static function onAfterAction($evt)
|
||||
public static function onBeforeAction($evt)
|
||||
{
|
||||
if(Yii::$app->request->isConsoleRequest) {
|
||||
return;
|
||||
@ -38,7 +38,6 @@ class Events
|
||||
private static function generateCSPRequestCheck()
|
||||
{
|
||||
return !Yii::$app->request->isAjax
|
||||
&& Yii::$app->response->format === 'html'
|
||||
&& Setting::isInstalled()
|
||||
&& !(Yii::$app->controller instanceof ErrorController)
|
||||
&& !(Yii::$app->controller instanceof OfflineController)
|
||||
|
@ -17,7 +17,7 @@ return [
|
||||
'offline.pwa.html' => 'web/pwa-offline/index'
|
||||
],
|
||||
'events' => [
|
||||
[Controller::class, Controller::EVENT_AFTER_ACTION, [Events::class, 'onAfterAction']],
|
||||
[Controller::class, Controller::EVENT_BEFORE_ACTION, [Events::class, 'onBeforeAction']],
|
||||
[AuthController::class, AuthController::EVENT_AFTER_LOGIN, [Events::class, 'onAfterLogin']],
|
||||
]
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user