You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes GetAuthorizationUrlParams::new() to stop unconditionally injecting screen_hint=sign-in into every generated authorization URL. Because the screen_hint field is already decorated with #[serde(skip_serializing_if = "Option::is_none")], defaulting it to None means the parameter is simply omitted from the URL unless the caller sets it explicitly — matching the WorkOS server's own default behaviour.
The previous hardcoded Some(SignIn) default overrode any server-side logic that applies when screen_hint is absent and prevented callers from relying on the server default.
The doc comment on the field ("Defaults to sign-in") continues to describe the server-side default accurately, since omitting the parameter leaves the server in control.
Confidence Score: 5/5
Safe to merge — the one-line change correctly removes an unintentional opinionated default, and all existing opt-in uses of screen_hint are unaffected.
The change is minimal and targeted: replacing a hardcoded Some(SignIn) with Default::default() in the constructor. The field is already gated by skip_serializing_if = "Option::is_none", so omitting it when unset is the correct behaviour. No other call-sites are touched, and the authkit helper path already handled screen_hint as optional independently.
No files require special attention.
Important Files Changed
Filename
Overview
src/resources/user_management.rs
Single-line fix: screen_hint default in GetAuthorizationUrlParams::new() changed from Some(SignIn) to None, so the parameter is omitted from the URL unless the caller sets it explicitly.
Sequence Diagram
sequenceDiagram
participant Caller
participant SDK as WorkOS Rust SDK
participant WorkOS as WorkOS Server
Note over Caller,WorkOS: Before fix
Caller->>SDK: GetAuthorizationUrlParams::new(redirect_uri)
Note over SDK: screen_hint = Some(SignIn)
SDK->>WorkOS: "GET /sso/authorize?...&screen_hint=sign-in"
WorkOS-->>Caller: "Auth URL with screen_hint=sign-in"
Note over Caller,WorkOS: After fix
Caller->>SDK: GetAuthorizationUrlParams::new(redirect_uri)
Note over SDK: screen_hint = None (omitted)
SDK->>WorkOS: GET /sso/authorize?... (no screen_hint)
WorkOS-->>Caller: Auth URL (server defaults to sign-in)
Note over Caller,WorkOS: Explicit override (unchanged behavior)
Caller->>SDK: "params.screen_hint = Some(SignUp)"
SDK->>WorkOS: "GET /sso/authorize?...&screen_hint=sign-up"
WorkOS-->>Caller: Auth URL with sign-up screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.