loginWithRedirect({ screen_hint: 'signup' }) not working

Hi! I’m trying to create a button that shows my signup form directly and have scoured the internet on the topic. I’ve found numerous topics and success stories that all show that his should work:

loginWithRedirect({ screen_hint: 'signup' })

I’m using the new Universal Login with NO customizations (apart from a few color changes and a logo) and still no luck. I get redirected to the login screen instead as if I’m not providing a parameter at all. Help!

1 Like

Hey there @nasko welcome to the community!

Interesting! Are you positive you are using new UL? I have really only seen this occur when classic UL is being used as this param has no effect there.

While I’m not positive which SDK you are using in particular, I’ve just tested this in our React Sample and it seems to be working as expected.

If you want to double check you’re using New UL you can do so here:

Keep us posted!

I’m using the new experience, yes. I’ve changed it from new to classic, to customized, then back to new like a dozen times while experimenting. I’m also using the React sample.

I’ll try and setup a brand new environment, because I’m really lost for ideas already :))

Nope, no luck with that too. I made sure there are no organizations too. Fresh tenant, fresh app, fresh universal login and fresh react sample. What else should I check?

1 Like

Hey @nasko thanks for the follow up, and for digging into it more!

Which browser are you testing in? Does the entire normal sample login flow work?

I’m using Chrome 109.0.5414.120 64-bit. Tried Edge too. Everything else works perfectly.

Interestingly when I open the network tab in dev tools I see that the /authorize is called without the screen_hint parameter. I copied the URL and added the parameter in and it then redirected me properly to the signup page. The issue is somewhere between me clicking the sample button and the authorize endpoint.

1 Like

Here is my button’s code:

<Button
   id="qsLoginBtn"
   color="primary"
   className="btn-margin"
   onClick={() => loginWithRedirect({ screen_hint: 'signup' })}
>
   Log in
</Button>
1 Like

Thanks for sharing! OK I think I may have figured this out - Please try the following:

onClick={() => loginWithRedirect({authorizationParams: {
                      screen_hint: "signup",
                    }})}

I had my versions mixed up (using pre v2) which mentions the introduction of authorizationParams:

Let us know if that does the trick!

2 Likes

Perfect! That did it! Thank you!

1 Like

Awesome!! Thanks for confirming here :rocket:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.