How to add strapi admin user column?

System Information
  • Strapi Version: 3.2.0-beta.1
  • Operating System: window 10
  • Database: postgresql
  • Node Version: 12.18.2
  • NPM Version: 6.14.5
  • Yarn Version:

Hello

I want to manage admin’s git access token. So…

  1. I created the column named gitaccesstoken in ‘strapi_administrator’ table
  2. I added gitaccesstoken field to schema.js, forms.js
  3. It reads gitaccesstoken db values and shows in the admin panel.
  4. But it ocuurs error 400 when i attempting to update info
    {“statusCode”:400,“error”:“Bad Request”,“message”:“ValidationError”,“data”:{“undefined”:[“this field has unspecified keys: gitaccesstoken”]}}

Is there anything wrong in my source code?
What is unspecified keys?

Thank you

Hi @yunji

I assume you have forked the strapi-admin package to make those changes, those keys come from the translations, so you will need to add your key there as well.

strapi/packages/strapi-admin/admin/src/translations at master · strapi/strapi · GitHub

I’m running into this same issue. I’ve added translations as well. Any thoughts on what I could be missing?

I’m also facing this issue. I’ve added translations as well.

@DMehaffy @cgen01 Have you guys found a solution?

I think the error is actually coming from validation/user.js. If you check out the code, the schema is still expecting something like

{
    email: validators.email.required(),
    firstname: validators.firstname.required(),
    lastname: validators.lastname.required(),
    roles: validators.roles.min(1),
    preferedLanguage: yup.string().nullable(),
 }
 .noUnknown();

and gitaccesstoken isn’t there