Has something changed in terms of sending verifica...
# ory-network
f
Has something changed in terms of sending verification emails to users? We have a verification flow that is a bit weird that doesn’t involve Ory sending the verification email and us setting users to verified ourselves (we will migrate to using the standard flow but this was a compromise to get Ory in place at all). On Friday we had a customer reach out to us saying they received a verification email from Ory. We’ve not triggered that email from our backend.
This is how the user looks like after creation
Copy code
"verifiable_addresses": [
      {
        "id": "<ID>",
        "value": "<EMAIL>",
        "verified": true,
        "via": "email",
        "status": "completed",
        "verified_at": "2023-10-06T07:01:10.150685Z",
        "created_at": "2023-10-06T07:01:09.517342Z",
        "updated_at": "2023-10-06T07:01:10.150763Z"
      }
    ],
It also look ok in the Ory Console
I’ll happily provide the user email address if that helps debugging.
Looking at activity in the console and
email delivery
I can see that it has happened more times but very sporadically.
s
do you use a webhook to do the verification on your side? how exactly does that work?
f
We make the user go through a registration flow and verification outside of Ory. We then create the user in a verified state in Ory. Since the user needs to set their password we do a reset password for them in Ory and make them set their password using the recovery token. (Very weird I know, working on fixing it 🙃 Our registration flow has a bunch of eligibility that we didn’t have time to change during the migration. Not everyone is allowed to register.)
s
Ok, makes sense. Do you know whether you create the user without a verified status, and update the status in a second API call? I'd assume that there is some kind of race-condition that sometimes causes emails to be send from our side.
f
We do it all in one call.
We do set the single entry in
verifiable_addresses
status to
completed
but perhaps there is something else there.
It could potentially be that we reset the verified with a patch for users that already verified ones though.
Copy code
{
                            "op": "replace",
                            "path": "/verifiable_addresses/0/verified",
                            "value": True,
                        },
                        {
                            "op": "add",
                            "path": "/verifiable_addresses/0/verified_at",
                            "value": f"{now}",
                        },
                        {
                            "op": "replace",
                            "path": "/verifiable_addresses/0/status",
                            "value": "completed",
                        },
Will have to dig a bit.
Nope, we don’t call patch for those users.
Sent you additional user specific information in dm if that might help debugging on your end.
Here it seems like it is set to active https://ory-community.slack.com/archives/C02MR4DEEGH/p1696415873808829?thread_ts=1696409791.111289&amp;cid=C02MR4DEEGH rather than completed, what is the expected value?
@steep-lamp-91158?
s
the possible values are
pending
,
sent
, and
completed
so I guess it is fine
also, that does not explain how this would result in flaky behavior
f
It does not 🙂
s
can you add logs on your side to verify that actually the correct payload is send?
after a bit of back-and-forth in private messages we found the issue is casing, this is the fix https://github.com/ory/kratos/pull/3571
🥳 1