steep-laptop-82187
09/22/2022, 7:47 AM@ory/kratos-client v0.10.1
I am able to create the user. But the issue is kratos is not running any validations on the password. is there any way to validate the password in recommended way. Thanks
here is the code:
const client = new V0alpha2Api(
new Configuration({
basePath: process.env.KRATOS_ADMIN_URL,
baseOptions: {
withCredentials: true,
},
})
);
const resp = await client.adminCreateIdentity({
traits: {
name: {
first: "xy",
last: "x",
},
email: "<mailto:admin@xyz.com|admin@xyz.com>",
},
schema_id: "default",
credentials: {
password: {
config: {
password,
},
},
},
});
identity.schema.json
{
"$id": "<https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json>",
"$schema": "<http://json-schema.org/draft-07/schema#>",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"minLength": 3,
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"password": {
"identifier": true
}
},
"verification": {
"via": "email"
},
"recovery": {
"via": "email"
}
}
},
"name": {
"type": "object",
"properties": {
"first": {
"title": "First Name",
"type": "string"
},
"last": {
"title": "Last Name",
"type": "string"
}
}
}
},
"required": [
"email"
],
"additionalProperties": false
}
}
}
magnificent-energy-493
For API Clients, the server typically responds with HTTP 400 Bad Request and the Registration Flow in the response payload as JSON.
steep-laptop-82187
09/22/2022, 10:24 AM