Grav: "Invalid security token; please reload the page and try again" only when saving theme settings

Created on 12 Jan 2017  路  8Comments  路  Source: getgrav/grav

Got Grav running great in my Linux, PHP7, Nginx space and can do everything fine except save theme settings. Just updated to latest build and all plugins as well with no change. Double checked file permissions as well. Using Grav v1.1.12 and Admin v1.2.7

Using Nginx conf supplied and no errors being logged.

Turned debug on and attached results.

grav_debug.txt

bug recreated

Most helpful comment

Please update nginx.conf:

    location / {
        try_files $uri $uri/ /index.php?_url=$uri&$query_string;
    }

All 8 comments

@mahagr looks like a gantry5 issue?

My bad... I now see that the appearance menu is specific to gantry themes.

Same as https://github.com/gantry/gantry5/issues/1748

I'm really not sure what could cause this to fail in Nginx as we just call

    $nonce = Utils::getNonce('gantry-admin');

and

protected function checkSecurityToken()
{
    /** @var Request $request */
    $request = $this->container['request'];
    $nonce = $request->get->get('nonce');
    return isset($nonce) && Utils::verifyNonce($nonce, 'gantry-admin');
}

screen shot 2017-01-13 at 10 49 41
Replicated

Please update nginx.conf:

    location / {
        try_files $uri $uri/ /index.php?_url=$uri&$query_string;
    }

Works like a charm now! Thanks

Not nginx.conf but well the configuration of the site in sites-available

Was this page helpful?
0 / 5 - 0 ratings

Related issues

balajmarius picture balajmarius  路  17Comments

marktaylor46 picture marktaylor46  路  26Comments

tmos picture tmos  路  21Comments

ursbraem picture ursbraem  路  29Comments

escopecz picture escopecz  路  17Comments