Require login based on form ID
回答済みI'm looking for a way to require login authentication based on the form ID that is selected by an anoymous user.
The configuration in Zendesk support to require login for end-users is a bit too heavy handed for our use-case, primarily because it applies across all brands.
Ideally, we would like to add code to the script.js file to check the form ID and the user's current status to redirect them to sign in.
-
Hi Danny K 👋
Yes, you can do this.
In your Help Center template - script.js// change to form ID and redirect Url you need
var formID = "123456";
var redirectUri = "https://sparkly.dev";
if (window.location.href.indexOf("/requests/new?ticket_form_id="+formID) > -1
&& HelpCenter.user.role === "anonymous") {
window.location.replace(redirectUri);
}
サインインしてコメントを残してください。
1 コメント