this is our identity schema: ```{ "$id": "<http...
# ory-network
a
this is our identity schema:
Copy code
{
  "$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
  "title": "Person",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          },
          "maxLength": 320
        },
        "username": {
          "type": "string",
          "title": "Username/nickname",
          "minLength": 2,
          "maxLength": 24
        }
      },
      "required": [
        "email",
        "username"
      ],
      "additionalProperties": false
    }
  }
}
s
you can add the
"<http://ory.sh/kratos|ory.sh/kratos>"
key with all the values to the username, but I think that only works for new users then...
you should try first on a staging project
@proud-plumber-24205 another request to extend the customisability for the account experience
c
yeah indeed, it only works for signup. But the current experience is really overwhelming our customer service. Most tickets are related to confused users.
So the sooner this can be fixed the better
Thanks @steep-lamp-91158
m
Hello @chilly-dentist-11746 I have configured my current Demo project so users can login with both email or their username. This is the schema I used, modified from yours:
Copy code
one bracket wrong, right one is below
Then ID is maybe less confusing. But as Patrik said try on staging first
a
will do
thanks @magnificent-energy-493
editor gives errors for some reason
is that normal ?
do I have to update via the CLI ?
CLI doesn’t work as well
m
Sorry I posted the wrong one, this should be working:
Copy code
{
  "$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
  "title": "Person",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "username": {
          "type": "string",
          "minLength": 2,
          "maxLength": 24,
          "title": "Username/nickname",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              }
            }
          }
        },
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          },
          "maxLength": 320
        }
      },
      "required": [
        "email",
        "username"
      ],
      "additionalProperties": false
    }
  }
}
a
@magnificent-energy-493 this allows me to login with email but not with my username. So same as before.
s
I meant that you can add the key to both, username and email, to be able to login with either
but that will (likely) only work for new users that sign up after that change
a
hmm ok so that doesn’t really fix the issue then 😞
h
@alert-painter-66256 would it be a fix if we showed
Email
instead of
ID
in the login form?