-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL query access from forge block #1733
Comments
There is no way to do that, the execution is on the server where we don't have access to the URL query params 🙁 |
The proxy do forward the whole URL to the backend, so typebot should get it at some point. And if there is another API used (I noticed the call to What I want to do can be done now with the set variable block with client side execution, but it is tedious for user to set up and require to disable the Query parameters is a pretty standard way to "parametrize" an application and it seems that it could be something typebot supports out of the box. |
Can you tell me exactly what you are trying to do here? |
I am implementing an OpenID auth block. The idea is that you can add the block, configure it with an OpenID provider and give it a variable, and if the variable is populated, the user has been authenticated with the OpenID service. But for this, I need to be able to access the query parameters that are added by the OpenID server when redirecting to typebot (especially The flow is simple: OpenID block checks if there is a query parameter containing a code, if yes it validate that code with the configured OpenID server and set the configured variable with the username/email, if no, it redirects to the OpenID auth endpoint. Usually, you put the OpenID block first in a flow, but this is not a requirement. But it means that after the OpenID block, if the user variable is set to a value, you can trust this value. |
I realized that typebot is sending the query variable as There is also a possibility that it might be a session variable as there is no way to determine the source of a variable. That's why it would be better to have a "hidden" variable that only code can use to make it cleaner. |
My prototype works if the user creates the |
But the variable is created since the user provides it to your OpenID config right? So if the variable has the same name as the query param the variable should be automatically populated |
The user doesn't have to provide the variable names to the block, because those names are fixed. To use the block, I have to instruct the user to create the following variables:
This is the first problem. The second problem is that I cannot be sure that those variables are coming from the URL, for example, the user might have an My suggestion is to add an The idea is similar to unix environment. Maybe other utility variables could come handy in the future, like the bot name or the user browser language whatever is relevant to the execution environment. You could also prefer a single variable The thing is, after having written a few forge plugins, I feel this would be a good approach. Also, I said "variable" but it could be another argument to the |
Ok I see, thank you I will have to investigate :) |
Is your feature request related to a problem? Please describe.
I am working on implementing an OpenID login block with forge. (block will be open source)
Describe the solution you'd like
I'd like to have access to the URL query parameters from my forge block. I think the best way to handle this would be to set an automatic variable. It should also work when
Hide query params on bot start
is set totrue
.So I could do something like this:
The text was updated successfully, but these errors were encountered: