Hi everyone! Could you please help me
# general
e
Hi everyone! Could you please help me
I need to implement the following customer experience So that both when logging in and registering, the user specifies his email, then enters the OTP code from the email and is immediately authorized. The flow itself is already configured and everything works great. But i have problem with passwordless user registration Both options are suitable 1 - there is only a login page, if the user entered an email that does not exist yet, then registration also occurs 2 - there is a login page and there is a registration page - I tried this method I found documentation on OTP and everything worked out for logging in, but for registering through a ory dashboard, I cannot enable the "Enable sign in after registration" settings option if a password is not used. Therefore, when registering, the user specifies an email, then enters a OTP code, and then he is asked to enter the email and code again - a second time, since he must log in How can this be avoided? So that the registration process looks the same as the login process? Thank you!
m
Hey @elegant-waiter-25841 (hope I ping the right Bruce 😅 ) You can definitely configure it this way. I guess its a problem on the Ory Console UI, but you can just enable the "Enable sign in after registration" option, save, and then disable password method after, save again. Now it should work as expected. Or you can use the Ory CLI to get the identity config
ory get identity-config
and check if the
registration after code hooks
contain "hook": session like so:
Copy code
"registration": {
        "after": {
          "code": {
            "hooks": [
              {
                "hook": "session"
              }
            ]
          },
then you should get the expected behaviour (getting a session after registration without extra interaction) let me know if that helped! @bland-eye-99092 weird bug on the console 🪲
b
As stated in the Console, "Enable sign in after registration" only affects password flows. For "code" flows we always issue a session after registration, hence no toggle in the UI for it.
e
I enabled the setting "Enable sign in after registration" but the behavior has not changed I attached the settings of my client
m
Can you check the
ory get identity-config
how the settings look for the snippet I posted above?
e
everything seems to be correct
m
That is strange 🤔 Can you maybe link me your project UI so I can try it out? (can be via DM if you dont want to share it publicly)
e
I'm testing locally for now I recorded a video of what it looks like Project ID sent in DM
@magnificent-energy-493 helped me to check and it is really so that if i go to the sign up page through /ui/login dashboard, then everything really works correctly there and i get session after registration But if I request an authorization flow through the "https://.../oauth2/auth?audience=...&client_id=...&redirect_uri=...&response_type=code&scope=openid+profile+offline_access+email&state=..." link, and click on "sign up" option there, then it will be like in my video
The registration page opened at .../ui/registration?flow=cca8d09f-0d11-4a93-89d0-eb61195569eb Perhaps flow id will help you look at the logs or something that can clarify why in this case the registration works differently I registered using this link and entered the code, but I didn't log in.
> if i go to the sign up page through /ui/login dashboard, then everything really works correctly there and i get session after registration I realized that I was also given a session, but for some reason the login page still opens
b
If this is part of the OAuth2 flows, there might be an error occuring, which unfortunately redirects to the welcome page at the moment. You can check by going through the network requests the page does.
e
Yes, it is oauth 2.0, authorization code flow, with ID token oidc I am confident in my implementation (and I don't see any errors anywhere), since it works for both auth0 and ory with a password registration And also, the callback for exchanging the authorization code for tokens simply is not called here, if I log in after registration, then everything works
It has started working correctly twice in a row🤔 Please tell me, did you change anything?
b
We didn't, no. This might be a weird interaction between registration/login and OAuth2, though. Does this only happen for unregistered accounts?
e
Yes, this only happens during registration (at least I didn't notice it when logging in) And when registering new accounts, since when trying to register with an email that is already registered, it says that "such an email is already registered - log in"
Anyway, thanks a lot for your help! The problem is not reproducible now
m
That means it works now as expected?
e
yes)