fix(server): add old secret check for admin secret update

This commit is contained in:
Lakhan Samani
2022-01-17 13:20:32 +05:30
parent c15b65b473
commit 3b4d0d9769
5 changed files with 19 additions and 10 deletions

View File

@@ -1093,7 +1093,7 @@ type Env {
input UpdateEnvInput {
ADMIN_SECRET: String
CONFIRM_ADMIN_SECRET: String
OLD_ADMIN_SECRET: String
DATABASE_TYPE: String
DATABASE_URL: String
DATABASE_NAME: String
@@ -6258,11 +6258,11 @@ func (ec *executionContext) unmarshalInputUpdateEnvInput(ctx context.Context, ob
if err != nil {
return it, err
}
case "CONFIRM_ADMIN_SECRET":
case "OLD_ADMIN_SECRET":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("CONFIRM_ADMIN_SECRET"))
it.ConfirmAdminSecret, err = ec.unmarshalOString2ᚖstring(ctx, v)
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("OLD_ADMIN_SECRET"))
it.OldAdminSecret, err = ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}