(expo/use-sso) Add redirectUrl parameter to startSSOFlow; remove expo partials#2005
(expo/use-sso) Add redirectUrl parameter to startSSOFlow; remove expo partials#2005LauraBeatris merged 7 commits intomainfrom
redirectUrl parameter to startSSOFlow; remove expo partials#2005Conversation
|
Hey, here’s your docs preview: https://clerk.com/docs/pr/2005 |
e09d8b5 to
ef80482
Compare
|
Blocked until clerk/javascript#5127 gets merged |
redirectUrl parameter to startSSOFlowredirectUrl parameter to startSSOFlow; remove expo partials
| const { createdSessionId, setActive, signIn, signUp } = await startSSOFlow({ | ||
| strategy: 'enterprise_sso', | ||
| identifier: email, | ||
| redirectUrl: '/', // The URL to redirect to after successful authentication |
There was a problem hiding this comment.
This is optional, by default it's sso-callback, I think we should update the useSSO reference
It shouldn't be a raw string - it's on the type level, but you'd call some Expo API to generate the URL based on the platform: Native would use a deep link scheme vs a web URL
|
The commit to add |
5218396 to
fbf01cb
Compare
Changed got release, therefore this PR is unblocked |
|
@LauraBeatris I'm not sure how to do linking with expo. I did |
| - `redirectUrl?` | ||
| - `string` | ||
|
|
||
| The full URL or path to redirect to after the SSO flow is complete. If not specified, defaults to `sso-callback` path. |
There was a problem hiding this comment.
If not specified, defaults to
sso-callbackpath.
But I don't see where the /sso-callback is used - users don't have to set anything up for this page, so if this /sso-callback path is actually hit behind the scenes, is this even worth mentioning?
There was a problem hiding this comment.
If deep linking is working - in this case, for Android since iOS currently has a bug from our tests so far (expo/expo#34187)
And redirectUrl is not defined, then we'll navigate to sso-callback, and if they don't have this route configured on the app, it'll lead to a 404 - reason why I think it's worth mentioning the default
There was a problem hiding this comment.
I'm confused. The examples never set up a /sso-callback page. Whenever I tested, the flows just worked. There was never a 404.
There was a problem hiding this comment.
On useOAuth, the default redirect URL used to be oauth-native-callback - however it's not mentioned in the previous guide:
On useSSO, the default is now set to sso-callback
Whenever I tested, the flows just worked. There was never a 404.
I recognize this is confusing... and this is the behavior for iOS in development mode, as I mentioned it could be a bug with Expo (expo/expo#34187) in which we haven't tried to reproduce on production iOS builds
When using useSSO on Android, the deep link does happen correctly if you provide a valid URL. The behavior can be found in this PR description: clerk/javascript#5102 (comment)
🔎 Previews:
What does this solve?
Adds a new
redirectUrlparameter tostartSSOFlowChecklist