ory / kratos

The most scalable and customizable identity server on the market. Replace your Homegrown, Auth0, Okta, Firebase with better UX and DX. Has all the tablestakes: Passkeys, Social Sign In, Multi-Factor Auth, SMS, SAML, TOTP, and more. Written in Go, cloud native, headless, API-first. Available as a service on Ory Network and for self-hosters.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=kratos
Apache License 2.0
11.31k stars 964 forks source link

Phone+email schema: verification email is sent when signed up with SMS code #4161

Open renom opened 1 month ago

renom commented 1 month ago

Preflight checklist

Ory Network Project

No response

Describe the bug

I use phone+email configuration. My registration flow config:

registration:
  lifespan: 10m
  ui_url: http://<host>/registration
  after:
    code:
      hooks:
        - hook: session
    password:
      hooks:
        - hook: session
    oidc:
      hooks:
        - hook: session

(show_verification_ui hook isn't enabled in config)

I've tested with the following schema configurations:

  1. Phone login with SMS code (OTP) + email login with password, email verification is enabled
  2. Phone login with SMS code (OTP) + email isn't an identifier (email login is disabled), but email verification is enabled
  3. Phone login with SMS code (OTP) + email login with email code (OTP), email verification is enabled

In any of these configurations, email Use code <code> to verify your account is sent after successful registration with SMS (OTP).

The only way to disable these emails is to disable email verification in schema:

"email": {
  "type": "string",
  "format": "email",
  "title": "E-mail",
  "minLength": 3,
  "ory.sh/kratos": {
    "credentials": {
      "password": {
        "identifier": true
      },
      "code": {
        "identifier": true,
        "via": "email"
      }
    },
-    "verification": {
-      "via": "email"
-    }
  }
},

Reproducing the bug

Configuration:

Then sign up with phone+SMS (OTP)

Relevant log output

time=2024-10-17T11:08:17Z level=info msg=Software quality assurance features are enabled. Learn more at: https://www.ory.sh/docs/ecosystem/sqa func=github.com/ory/x/metricsx.New file=/go/pkg/mod/github.com/ory/x@v0.0.660/metricsx/middleware.go:176 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:17Z level=info msg=TLS has not been configured for public, skipping func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:17Z level=info msg=TLS has not been configured for admin, skipping func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:17Z level=info msg=Courier worker started. func=github.com/ory/kratos/cmd/courier.Watch file=/go/src/github.com/ory/kratos/cmd/courier/watch.go:94 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:17Z level=info msg=Starting the admin httpd on: 0.0.0.0:4434 func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:17Z level=info msg=Starting the public httpd on: 0.0.0.0:4433 func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:22Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/welcome sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration/browser? x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:GET path:/self-service/registration/browser query:<nil> remote:172.18.0.25:56576 scheme:http]
time=2024-10-17T11:08:22Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/welcome sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration/browser? x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:GET path:/self-service/registration/browser query:<nil> remote:172.18.0.25:56576 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:text/html; charset=utf-8 location:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 vary:Origin] size:119 status:303 text_status:See Other took:10.946605ms]
time=2024-10-17T11:08:23Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path://self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47728 scheme:http]
time=2024-10-17T11:08:23Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path:/self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47728 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:application/json; charset=utf-8 vary:Origin] size:3757 status:200 text_status:OK took:2.981164ms]
time=2024-10-17T11:08:32Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:310 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56576 scheme:http]
time=2024-10-17T11:08:32Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:310 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56576 scheme:http] http_response=map[headers:map[access-control-allow-credentials:true access-control-allow-origin:* access-control-expose-headers:Content-Type cache-control:private, no-cache, no-store, must-revalidate location:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 vary:Origin] size:0 status:303 text_status:See Other took:10.944389ms]
time=2024-10-17T11:08:33Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path://self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47802 scheme:http]
time=2024-10-17T11:08:33Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path:/self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47802 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:application/json; charset=utf-8 vary:Origin] size:1768 status:200 text_status:OK took:2.173194ms]
time=2024-10-17T11:08:34Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:208 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56576 scheme:http]
time=2024-10-17T11:08:34Z level=debug msg=Preparing registration code func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 address=Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:34Z level=info msg=Sending out registration email with code. func=github.com/ory/kratos/selfservice/strategy/code.(*Sender).SendCode file=/go/src/github.com/ory/kratos/selfservice/strategy/code/code_sender.go:108 audience=audit registration_code=Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". registration_code_id=c51b3ff7-3eda-46fb-a42c-5ecd9dd25d02 registration_flow_id=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 service_name=Ory Kratos service_version=
time=2024-10-17T11:08:34Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:208 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56576 scheme:http] http_response=map[headers:map[access-control-allow-credentials:true access-control-allow-origin:* access-control-expose-headers:Content-Type cache-control:private, no-cache, no-store, must-revalidate location:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 vary:Origin] size:0 status:303 text_status:See Other took:76.247277ms]
time=2024-10-17T11:08:34Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path://self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47858 scheme:http]
time=2024-10-17T11:08:34Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path:/self-service/registration/flows query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:47858 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:application/json; charset=utf-8 vary:Origin] size:2460 status:200 text_status:OK took:1.847368ms]
time=2024-10-17T11:08:35Z level=info msg=[DEBUG] POST https://gate.smsaero.ru/v2/sms/send func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/x@v0.0.660/logrusx/helper.go:141 audience=application service_name=Ory Kratos service_version=
time=2024-10-17T11:08:35Z level=debug msg=Courier sent out mailer. func=github.com/ory/kratos/courier.(*httpChannel).Dispatch file=/go/src/github.com/ory/kratos/courier/http_channel.go:103 audience=application http_server=https://gate.smsaero.ru/v2/sms/send message_id=e09e8efd-524b-4b90-b6b3-26d0fad5f3fe message_nid=9685b101-890f-49f1-a460-7f6a90f0fb08 message_subject= message_template_type=registration_code_valid message_type=sms service_name=Ory Kratos service_version=
time=2024-10-17T11:08:35Z level=debug msg=Courier sent out message. func=github.com/ory/kratos/courier.(*courier).DispatchMessage file=/go/src/github.com/ory/kratos/courier/courier_dispatcher.go:73 audience=application channel=sms message_id=e09e8efd-524b-4b90-b6b3-26d0fad5f3fe message_nid=9685b101-890f-49f1-a460-7f6a90f0fb08 message_subject= message_template_type=registration_code_valid message_type=sms service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http]
time=2024-10-17T11:10:20Z level=debug msg=Running PostRegistrationPrePersistHooks. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:113 audience=application flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=00000000-0000-0000-0000-000000000000 service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=debug msg=ExecutePostRegistrationPrePersistHook completed successfully. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:148 audience=application executor=*hook.CodeAddressVerifier executor_position=0 executors=[*hook.CodeAddressVerifier] flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=00000000-0000-0000-0000-000000000000 service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=info msg=A new identity has registered using self-service registration. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:214 audience=audit http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=debug msg=Running PostRegistrationPostPersistHooks. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:234 audience=application flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=info msg=Sending out verification email with verification code. func=github.com/ory/kratos/selfservice/strategy/code.(*Sender).SendVerificationCodeTo file=/go/src/github.com/ory/kratos/selfservice/strategy/code/code_sender.go:367 audience=audit email_address=Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version= verification_code_id=0bd25cfc-c82b-4db3-bcc7-8b7ecfa2c0dd verification_link_token=Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". via=email
time=2024-10-17T11:10:20Z level=debug msg=ExecutePostRegistrationPostPersistHook completed successfully. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:274 audience=application executor=*hook.Verifier executor_position=0 executors=[*hook.Verifier *hook.SessionIssuer] flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=debug msg=ExecutePostRegistrationPostPersistHook completed successfully. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:274 audience=application executor=*hook.SessionIssuer executor_position=1 executors=[*hook.Verifier *hook.SessionIssuer] flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=debug msg=Post registration execution hooks completed successfully. func=github.com/ory/kratos/selfservice/flow/registration.(*HookExecutor).PostRegistrationHook file=/go/src/github.com/ory/kratos/selfservice/flow/registration/hook.go:281 audience=application flow_method=code http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] identity_id=127dd2b8-a947-4857-b061-62c46c029a9f service_name=Ory Kratos service_version=
time=2024-10-17T11:10:20Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 accept-encoding:gzip, deflate, br, zstd accept-language:en-US,en;q=0.5 content-length:230 content-type:application/x-www-form-urlencoded cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://dev-backoffice.sporagt.ru priority:u=0, i referer:https://dev-backoffice.sporagt.ru/ory/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 sec-fetch-dest:document sec-fetch-mode:navigate sec-fetch-site:same-origin sec-fetch-user:?1 upgrade-insecure-requests:1 user-agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 x-forwarded-port:80 x-forwarded-ssl:on x-original-uri:/ory/.ory/kratos/public/self-service/registration?flow=81ea899a-a7c5-4f1b-ba2c-e8671624e4a1 x-real-ip:10.0.16.209] host:dev-backoffice.sporagt.ru method:POST path:/self-service/registration query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.25:56998 scheme:http] http_response=map[headers:map[access-control-allow-credentials:true access-control-allow-origin:* access-control-expose-headers:Content-Type cache-control:private, no-cache, no-store, must-revalidate location:https://dev-backoffice.sporagt.ru/ory/ set-cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". vary:Origin] size:0 status:303 text_status:See Other took:44.930385ms]
time=2024-10-17T11:10:20Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path://sessions/whoami query:<nil> remote:172.18.0.21:48154 scheme:http]
time=2024-10-17T11:10:20Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path:/sessions/whoami query:<nil> remote:172.18.0.21:48154 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:application/json; charset=utf-8 vary:Origin x-kratos-authenticated-identity-id:127dd2b8-a947-4857-b061-62c46c029a9f] size:1414 status:200 text_status:OK took:21.828505ms]
time=2024-10-17T11:10:20Z level=info msg=started handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:134 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path://self-service/logout/browser query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:48162 scheme:http]
time=2024-10-17T11:10:20Z level=info msg=completed handling request func=github.com/ory/x/reqlog.(*Middleware).ServeHTTP file=/go/pkg/mod/github.com/ory/x@v0.0.660/reqlog/middleware.go:147 http_request=map[headers:map[accept:application/json, text/plain, */* accept-encoding:gzip, compress, deflate, br connection:close cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". user-agent:axios/1.7.4] host:kratos:4433 method:GET path:/self-service/logout/browser query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:172.18.0.21:48162 scheme:http] http_response=map[headers:map[cache-control:private, no-cache, no-store, must-revalidate content-type:application/json; charset=utf-8 vary:Origin] size:197 status:200 text_status:OK took:8.777587ms]
time=2024-10-17T11:10:21Z level=debug msg=Courier sent out message. func=github.com/ory/kratos/courier.(*SMTPChannel).Dispatch file=/go/src/github.com/ory/kratos/courier/smtp_channel.go:136 audience=application message_from=hello@sporagt.ru message_id=3cd8dc47-adc9-4175-9279-8d64476e6b5b message_nid=9685b101-890f-49f1-a460-7f6a90f0fb08 message_subject=Use code 683190 to verify your account message_template_type=verification_code_valid message_type=email service_name=Ory Kratos service_version= smtp_server=mail.nefrosovet.ru:587 smtp_ssl_enabled=false
time=2024-10-17T11:10:21Z level=debug msg=Courier sent out message. func=github.com/ory/kratos/courier.(*courier).DispatchMessage file=/go/src/github.com/ory/kratos/courier/courier_dispatcher.go:73 audience=application channel=email message_id=3cd8dc47-adc9-4175-9279-8d64476e6b5b message_nid=9685b101-890f-49f1-a460-7f6a90f0fb08 message_subject=Use code 683190 to verify your account message_template_type=verification_code_valid message_type=email service_name=Ory Kratos service_version=

Relevant configuration

No response

Version

git version

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker Compose

Additional Context

No response

renom commented 1 month ago

I just found out that it works the other way around. If I sign up with an email code (OTP), SMS message Your verification code is: <code> is sent then (but email with a verification code isn't).

renom commented 1 month ago

After a little research, it seems enabling of verification hook is hardcoded:

  1. Registration flow
  2. Settings flow
renom commented 3 weeks ago

Extra info for setting "Phone login with SMS code (OTP) + email login with password, email verification is enabled": If I enable show_verification_ui and then register with email+password, the verification form accepts SMS code but doesn't accept email code. So the only possible outcome is "email isn't verified", "phone is verified". If I register with phone+sms and then verify email with show_verification_ui, it works perfectly though.

UPDATE: it's bug of kratos-selfservice-ui-node