Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}]).then(function (result) {
setContract('Identity', uuid);
elem('details').style.display = "block";
swal({
title: 'Recovery Complete',
type: 'success',
text: 'Your account was recovered successfully.'
}).catch(swal.noop);
}, function (dismiss) {
if(window.localMediaStream)
alertShow(opts) {
swal(opts).catch(swal.noop);
},
confirmShow(opts) {
error => {
if (error.response.status >= 500) {
swal({
type: 'error',
title: 'Oops...',
html: 'Something went wrong! Please try again.'
})
} else if (error.response.status === 401 && store.getters.authUser) {
swal({
title: 'Session Expired!',
html: 'Please log in again to continue.',
allowOutsideClick: false
})
.then(() => store.dispatch('logout'))
.catch(swal.noop)
}
return Promise.reject(error)
}
)
showLoginAlert() {
swal({
title: 'Login Required',
text: "You need to log in to proceed with this action.",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Log in'
}).then(function () {
const url = encodeURIComponent(window.location.href)
window.location = "/Security/login?BackURL=" + url
}).catch(swal.noop);
}
}
function showQRPopup(title, json, show_scanner) {
swal({
title: title,
html: getQRFromJson(json) + '<br>' +
'<div class="ui form"><div class="field"><textarea rows="8">' +
JSON.stringify(json, null, 2) +
'</textarea></div></div>',
showCancelButton: show_scanner,
confirmButtonText: show_scanner ? 'Open Scanner' : 'Ok'
}).then(function() {
if(show_scanner)
elem('scanner').click();
resetUrl();
}).catch(swal.noop);
}