"Invalid login" on panel

Hi everyone, I’ve been using Kirby around a year now, though I wouldn’t say I’m very adept at it by any means. I’ve been hosting my site on NearlyFreeSpeech, and have always had issues with read/write permissions, logging into the panel, etc., but have just made do this whole time, without being able to really figure out and solve the root of all my problems.

Recently, I thought I came close by following the advice in this post and running

chown -R :web .

from my root folder after sshing into it. For a brief evening, that worked perfectly: no more read/write permission issues, could log into the panel no problem. However, then I updated my site locally, so I deleted everything from NFSN, reuploaded my local files via SFTP, and then ran

chown -R :web .

again. Now, however, when I try to log into my site, I get “invalid login”, even though I’m still able to log into the panel perfectly well when I’m running my site locally. Does anybody know why this could be happening? I thought I was just executing the exact same steps that got my site working the first time, but now they don’t. Any help would be much appreciated!

The first step would be to temporarily enable debug mode in your config to get more details about the error, because the invalid login is just a fallback error message.

Hi texnixie, thanks for jumping in! I have it enabled in my config.php with

<?php 

return [
    'debug'  => true,
];

But when I attempt to login to the NFSN site, I still just get the generic “Invalid login” error message on the webpage. In the console, I see this:

Failed to load resource: the server responded with a status of 403 () /api/auth/login:1

But that’s all.

When I modify my config to have a bit more debugging code like this,

<?php 

return [
    'debug'  => true,
    'auth' => [
            'debug' => true
        ]
];

Then the “invalid login” warning disappears (though I still can’t login), and I see these errors in the console:

POST https://mydomain.nfshost.com/api/auth/login 401 (Unauthorized)
index.min.js:2

TypeError: Cannot read properties of undefined (reading ‘challengeDestroyed’)
at a.onError (index.min.js:2:331729)
at _n (vue.min.js:11:22257)
at a.r (vue.min.js:11:10679)
at _n (vue.min.js:11:22257)
at t.$emit (vue.min.js:11:44724)
at a.login (index.min.js:2:330318)
index.min.js:2

Hello! Just bumping this post in case anyone has any insights on this issue. I would really appreciate any advice that anyone could give! I’ve tried deleting everything in my root folder and starting over, but the problem persists.

Do you run into the same issue if you upload a fresh Starterkit instead (and then run chown -R :web .)?