Strapi Version: 4.2.2
Operating System: Windows 10
Node Version: v14.19.3
NPM Version: 6.14.17
Following a migration from 3.6.9, I have an interesting problem. Whenever I try to access any of:
- Media Library
- Settings>User&Permissions Plugin>Roles
the strapi console logs a 401 error and I’m immediately redirected to the login page.
Has anyone experienced this or have any idea where I should be looking for trouble shooting this?
In terms of the migration, I followed the steps in the Migration Guide (took a while!) and I used the Beta migration scripts for migrating the data.
So I dug a bit further in to this. When clicking on the content-types-builder button in the admin ui, it’s trying to validate a jwt token using a secret. That check is failing. The strange thing is, that section of code is not being hit at all in a clean strapi v4 install I have set up for comparison. The section of code in question is in node_modules/@strapi/plugin-users-permissions/server/services/jwt.js. The verification fails on line 42 causing an Invalid Token rejection and ultimately setting an authenticated boolean to false. The thing I don’t understand is, I thought that plugin_users_permissions was only used for validating external users, not admin users. So why would this piece of code be being called in the first place? Thanks for any help!
Ok - this was solved by removing some dependencies that were left over from 3.6.9. Removed knex and replaced sqlite3 with better-sqlite3. I’m not sure which of these had the effect, but none-the-less, it is now working.
I have the same issue. I am super admin account and getting 401 for the above pages.
Is there anyone having the same issue and can help me?
Same here. Just started doing it today all of a sudden.