Skip to content

Customising the returned UI nodes #183

Answered by aeneasr
Rodeoclash asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Rodeoclash ! So to understand your use case a bit better: You want to show different sign in options depending on e.g. query parameter? One option you could do is to use Ory Elements and filter out those options you do not want to show the user. In pseudo-code

const { data: login } = await ory.createBrowserLoginFlow()

// Let's say you decide which options to show based on a URL query parameter
let filter
if (router.query('show') === 'employee') {
  filter = (node) => // ...
} else {
  filter = (node) => // ...
}

const nodesToRender = login.ui.nodes.filter(filter)

// And then pass that to Ory Elements

Hope this helps!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Rodeoclash
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants