<@U04UQ68083H> We're using ory's createBrowserLogi...
# ory-copilot
c
@chilly-king-10285 We're using ory's createBrowserLoginFlow in a nextJS app, but after completing login with oidc, it sends back user to registration. This was working fine before, are there any updates?
c
A message from kapa.ai
Yes, there have been some updates regarding the flow of Ory's createBrowserLoginFlow. After a successful OIDC flow, Ory redirects users back to the registration page when some identity traits, such as a phone number, couldn't be mapped using the data received from the social sign-in provider and require manual input from the user. This happens when the Jsonnet configuration for the social sign-in provider is incorrect and Ory can't map the data correctly, causing the registration page to get stuck in a redirect loop. To fix this issue, you need to adjust the Jsonnet configuration for the social sign-in provider so that the data from the provider gets mapped correctly to the Identity Schema. You can read more about this in the [Ory documentation](https://www.ory.sh/docs/troubleshooting/troubleshooting-social-sign-in#redirect-loops-after-successful-registration). Also, it's important to add the "session" hook to the after
oidc
registration hooks. Otherwise, your users need to use the login flow again to be able to get a session. You can find more details about this in the [Ory documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#successful-registration). Here is an example of how to add the "session" hook:
Copy code
yaml selfservice:     flows:       registration:         after:           password:             hooks:               - hook: session           oidc:             hooks:               - hook: session # Always enable this for oidc flows or the user experience suffers significantly!
I hope this helps! Let me know if you have any other questions.
c
@chilly-king-10285 So if a user directly tries to sign-in without sign-up, will it follow the same behavior? When were this updates forced?
c
A message from kapa.ai
If a user tries to directly sign-in without sign-up, the behavior will depend on the configuration of your Ory setup. If you have enabled the feature "Sign In After Registration", users will get a session immediately after they sign up, meaning they don't have to sign in with their newly created account to get access to your services. They can access all the features immediately [source](https://www.ory.sh/docs/identities/sign-in/actions#log-in-users-after-registration). However, if you have enabled the feature "Require Verified Address for Login", users will need to verify their email address before they can sign in using other devices or browsers and get more active sessions as a result [source](https://www.ory.sh/docs/identities/sign-in/actions#allow-login-only-with-verified-email). As for when these updates were enforced, the knowledge sources provided do not contain this information. For the most accurate and up-to-date information, I recommend checking the official Ory documentation or their GitHub repository.