Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send right field type in registration/login request information #175

Closed
zepatrik opened this issue Jan 20, 2020 · 1 comment · Fixed by #209
Closed

Send right field type in registration/login request information #175

zepatrik opened this issue Jan 20, 2020 · 1 comment · Fixed by #209
Assignees
Labels
bug Something is not working.

Comments

@zepatrik
Copy link
Member

Describe the bug

Currently we get type: "text" for every string type regardless of the format set.

{
  ...,
  "methods": {
    "password": {
      "method": "password",
      "config": {
        "action": "...",
        "method": "POST",
        "fields": {
          "csrf_token": {
            "name": "csrf_token",
            "type": "hidden",
            "required": true,
            "value": "..."
          },
          "password": { "name": "password", "type": "password", "required": true },
          "traits.email": { "name": "traits.email", "type": "text" }
        }
      }
    }
  }
}

Expected behavior

Kratos should set the corresponding HTML input type/pattern for the format set in the identity traits schema.

@zepatrik zepatrik self-assigned this Jan 20, 2020
@zepatrik
Copy link
Member Author

zepatrik commented Jan 21, 2020

mapping:

{
"type": "string",
"format": "date-time", // -> type datetime-local   NOTE: no timezone!
"enum": ["foo", "bar"], // -> two radio inputs
"format": "email", // -> type email
"format": "date", // -> type date
"format": "time", // -> type time
"format": "uri", // -> type url   NOTE: url is more specific than uri
"format": "regex", // -> type text
"pattern": someRegex, // -> type from format & pattern regex
"minLength": n, // -> minlength n
"maxLength": n, // -> maxlength n
"const": value, // -> type from type & disabled true
}

@aeneasr aeneasr added this to the v0.1.0-alpha.1 milestone Jan 27, 2020
@aeneasr aeneasr added the bug Something is not working. label Jan 27, 2020
@zepatrik zepatrik mentioned this issue Jan 30, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants