Jump to content

Question

I have searched for a solution, but have only found situations that don't resolve my problem.

My need: at login, a user with a password that has not been changed in XX-days will be directed to change their password (should this be a submission page or a password change form) . The system, knowing what their current password is, will not allow them to use the same one. Once the password is changed, the user will continue to the page they were trying to sign into.

My level of experience with Caspio can be described at best as self taught. I was tasked with the implementation of my project with no prior knowledge of Caspio or coding. Please forgive me if I have followup questions or need additional direction.

Thank you!!

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
On 2/23/2019 at 7:33 AM, Harbinger said:

Thanks for posting!

 

Unfortunately, my need centers around the system forcing the user to change their password to something different after XX days. This solution does not address that part.

 

Is there another place I should look?

 

Thanks!

Share this post


Link to post
Share on other sites
  • 0
On 2/23/2019 at 7:30 AM, Harbinger said:

Thanks for posting!

 

Unfortunately, my need centers around the system forcing the user to change their password to something different after XX days. This solution does not address that part.

 

Is there another place I should look?

 

Thanks!

Share this post


Link to post
Share on other sites
  • 0

Hi @SteveB,

What you are trying to achieve can be achieved using some JavaScript Code.

First, you will need to add a field in your user table to detect when was the last time the password was updated.

image.png.0972124d5b27d18b9e23802d421268ed.png

 

Then create an HTML DataPage which will serve as your login page, if you don't have one yet.  Just use your Authentication base on your user table, and don't forget to disable Ajax loading.

image.png.5934744bfca44eae0ab873e40c40608a.png

Then paste the code below.

<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {

/* Getting the date where your password was Last Updated date on your user table where this authenticaion is based. Just update this code to matched with what you have in your authentication */
var datesVar = [@authfield:Password_Updated*];

//Adding 90 days to it, to set its validity
var Validity = new Date(datesVar);
Validity.setDate(Validity.getDate(datesVar) +90);


// Getting Current Date
var d1 = new Date(); 
// 90 days validity
var d2 = new Date(Validity);

//Check if password is Valid, within 90 days validity
if (d2 <=d1)
  {
  alert('Password Valid');
//redirect to the page that you prefer
window.location.href = "https://www.google.com/";
  }
else {

  alert('Password Needs to be updated');
  
/*redirect to the Single Update Page to update password, and passed the ID of the user who logged-in in the authentication.
I think you will need to redeploy the single update DataPage that I've exported and update the deployment code below 'https://c5eib829.caspio.com/dp/d90b60002d732bc2a6364c29b9f9' 
*/
window.location.href = "https://c5eib829.caspio.com/dp/d90b60002d732bc2a6364c29b9f9?id=[@authfield:Password_ID]";
}

});
</script>

Then on your Single Update DataPage, you can set it to redirect to your home page or preferred DataPage once the user has updated his/her password.

I've also attached an exported copy of the DataPage that I've worked with so that you can see how it works.

I hope this helps.


Regards,

TsiBiRu

CaspioData_2019-Mar-19_2220.zip

Share this post


Link to post
Share on other sites
  • 0

Hi there!

The previous reply is correct, you need to have the Last Update field. However, I think Javascript is not necessary. JS would probably be my last option on workarounds. :D

image.thumb.png.53d02dbabd3b06891b70f368a788ef01.png

So, how can you do this without Javascript?

You can use Tasks to send out email for the users who has outdated Email. You can set it up like this: (You can change the conditions based on your requirement)

image.thumb.png.d4aa54131601e63b5b01a13e36ccf6d6.png

On the Message Body, you can put in the link of the DataPage that will enable the users change their passwords. 

Of course, you can add some actions in the task as well, like for example, once a user does not change the password after 90 days, this user will be inactive (using checkboxes prolly)

Hope this helps();

Glitch :wub:

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...

×
×
  • Create New...