Reset password page integration
1. When user clicks on "forgot password" in the login widget he gets to the page that contains the "forgot password" widget, E.G:
You will have to create a page for that in your content site,
this page will have the first section of the reset password process and will contain this iframe url.
E.G:
Content site page:
https://www.tradesmarter.com/forgot-password/
Iframe inside the content site page:
https://trading.tradesmarter.com/forgot-password
this is where the user enter his email address so he will get an email with a reset password link.
2. Once the user submit his email address in the above page, he gets an email with a link for resting his password.
You will have to create a page with the slug\url "reset-password" for this stage in your content site and we will place a link to this page (with token parameter) in the email that the user will get.
E.G:
content site page:
https://www.tradesmarter.com/reset-password/?token=a81f74491
This page will contain an iframe that allow the user to choose a new password like so:
https://trading.tradesmarter.com/reset-password
3. in this page you will have to fetch the token parameter form the url and when the page loads attach it to the iframe url.
iframe link will be:
https://trading.tradesmarter.com/reset-password?
iframe parameter will be:
token=a81f74491
All together the iframe link should look like that:
https://trading.tradesmarter.com/reset-password?token=a81f74491
so all together you page will look like that:
You can add this script to you page asuming you an an id of "passwordWidget" to your iframe :
$(document).ready(function(){
function getUrlParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
}
}
}
var tokenValue = getUrlParameter('token');
var _src = jQuery("#passwordWidget").attr("src");
jQuery("#passwordWidget").attr("src", _src + 'token=' + tokenValue);
}):
this way every time the user gets to the reset page after being linked from the email he got, he will be able to choose and set a new password