client-ui
Version:
Testing implementation of nodeJs Backend, angular frontend, and hopefully in a way that this can be deployed to s3/cloudfront
51 lines (47 loc) • 1.57 kB
JavaScript
$(document).ready(function() {
attemptEmailVerification();
setLoginReminder();
});
function attemptEmailVerification() {
var urlParameters = getUrlParameters();
var email = false;
if (urlParameters.hasOwnProperty('e')) {
email = urlParameters['e'];
}
var hash = false;
if (urlParameters.hasOwnProperty('h')) {
hash = urlParameters['h'];
}
if(email && hash) {
var url = config.coreApiUrl + 'verifyEmail/' + email + '/' + hash;
$.ajax({
url: url,
dataType: 'json',
method: 'GET',
success: handleSuccess,
error: handleError
});
} else {
handleError();
}
}
function handleSuccess(data) {
var messageProgress = 'status-message-progress-712136';
var messageSuccess = 'status-message-success-101397';
document.getElementById(messageSuccess).style.display = 'block';
document.getElementById(messageProgress).style.display = 'none';
}
function handleError(xhr,status,error) {
var messageProgress = 'status-message-progress-712136';
var messageError = 'status-message-error-449700';
document.getElementById(messageError).style.display = 'block';
document.getElementById(messageProgress).style.display = 'none';
}
function setLoginReminder() {
if (!localStorage || !localStorage.getItem('client')) {
var continueButton = document.getElementById('continue-loan');
if(continueButton){
continueButton.title = 'login may be required to continue';
}
}
}