Hello, is there a way to get the recipe id during initializing the session (Session.init) on the ser...
m
Hello, is there a way to get the recipe id during initializing the session (Session.init) on the server? The user can choose the recipe on the client and I want to know that before initializing the session.
r
Hey!
Can you elaborate on what this flow is exactly? I don't think i understand it.
@Musibat
m
Sorry, I was away. So, we have multiple instances of the application and the users(internal and external) are exposed to the application on the basis of the recipe they login through. We then want to override the original implementation. I hope it makes sense
r
Hmmm. You should initialise all the recipes on the backend in that case
I mean all the ones you use
Cause recipe init is a static thing that happens once per process
Does that make sense?
m
Yes, that makes sense. Now my question is how would i know which recipe was used to login during session init?
r
You can get the request object from the userContext. From there, you can get the request headers which would contain a rid header pointing to the recipe used.
You could also override the sign in / sign up apis in each of the recipes and add some info to the userContext object which you could then read in createNewSession to know which function it came from.
m
thank you. I will try that out
r
found the bug! we will release a new version. Thanks