Jump to content
  • 0
Sign in to follow this  
JanineB

Conditional Authentication

Question

I want my user to be able to log-in to the Webpage, when and only when the admin has approved his account.

We have a checkbox field (Approved) that can identify if the user is approved by the admins.

How can I have a conditional log-in form?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @JanineB,

You can create a single Log-In screen for this.

Alter the code provided in the documentation just add (& "[@authfield:Checkbox]" == "1"). This action is just to identify if the checkbox is checked or not.

Quote

<script>

if("[@authfield:User]" == "Yes" & "[@authfield:Checkbox]" == "1"){

window.location = "Home Page URL";

}

else if("[@authfield:User]" == "Yes" & "[@authfield:CheckBox]" == "0"){

window.location = "Log-In URL";

}

else{

window.location = "Log-In URL";

}

</script>

Please note that in checkbox (Yes/check = 1) and (No/uncheck = 0)

You can refer to this documentation: https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/

 

I hope this helps :D 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...