samlify
samlify copied to clipboard
allow sp relayState to be overridden in login request
Addresses https://github.com/tngan/samlify/issues/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) => {...});