Skip to content

allow sp relayState to be overridden in login request#583

Open
marcobaldo wants to merge 4 commits intotngan:masterfrom
marcobaldo:master
Open

allow sp relayState to be overridden in login request#583
marcobaldo wants to merge 4 commits intotngan:masterfrom
marcobaldo:master

Conversation

@marcobaldo
Copy link
Copy Markdown

@marcobaldo marcobaldo commented Oct 23, 2025

Addresses #163.

The changes allow you to override at the createLoginRequest call, while keeping the original relayState at the sp level as the default. This also turns the 3rd param into an options object, with tests and docs (for tag replacement) updated, while maintaining backwards compatibility.

// both valid
const { id, context } = sp.createLoginRequest(idp, "redirect", {
	customTagReplacement: (loginRequestTemplate) => {...},
	relayState: 'override relay state',
});
const { id, context } = sp.createLoginRequest(idp, "redirect", (loginRequestTemplate) => {...});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant