Redirect Web Page Event
The redirect web page event allows you to redirect your apps users to a different webpage at certain points. This event is used in certain workflows, for example if you choose to authenticate with a third party authentication mechanism e.g. Google. In this case, you need to redirect to the the user to the Google login page.
You can set up the redirect web page event in 4 quick and easy steps.
- Step 1. create a redirect web page endpoint
- Step 2. create a redirect web page action
- Step 3. add the redirect web page event
- Step 4. build and test
Go to the endpoint tab in the Dittofi Design Studio and click "+ New Endpoint" to add a new endpoint. Give the endpoint the name "Redirect web page", the path "/v1/redirect_web_page", the description "Endpoint to redirect user to google" request method to "get" and the res content type to "text/html".
The "Render web template" final configuration is shown below.
Press "Save" and close the endpoint.
Next, head over to the actions tab and add a new action by clicking "+ Add Action". From here, you can rename the action to "Redirect web page", set the trigger component to endpoint and link the endpoint to the "Redirect web page endpoint" that we made in from step 1.
The last part of this step is to add a variable to your action under the "Variables" section. This variable will store the web address or URL value that you want to redirect users to. In our case we set this to https://www.google.com/.
Next, add a new event to the actions and events graph by clicking the "+ Add Event" button. Set the event type to redirect web page, set the description to "Redirect users to google.com", leave the response code unchanged and select the redirect URL to the "RedirectURL" variable that we created in Step 2 (recall that this holds the value https://www.google.com/).
The final set of configuration is shown below.
Save your action and close it.
To build the code, click the "Build code" button. After the code has built you need to enter the address of your endpoint. In our case this is the one shown below: