mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-27 15:31:29 +00:00
Revert JS changes on verify pages
This commit is contained in:
parent
f6c133abe4
commit
c65078f94e
2 changed files with 34 additions and 39 deletions
|
@ -14,15 +14,15 @@
|
|||
<script>
|
||||
const ENDPOINT = '<?php echo LBRY::getApiUrl('/user_email/confirm')?>'
|
||||
|
||||
const verifyUser = function(temporary_auth_token, email, verification_token, recaptcha) {
|
||||
const url = `${ENDPOINT}?auth_token=${temporary_auth_token}&email=${encodeURIComponent(email)}&verification_token=${verification_token}&recaptcha=${recaptcha}`;
|
||||
var verifyUser = function(temporary_auth_token, email, verification_token, recaptcha) {
|
||||
|
||||
const url = `${ENDPOINT}?auth_token=${temporary_auth_token}&email=${encodeURIComponent(email)}&verification_token=${verification_token}&recaptcha=${recaptcha}`;
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
if (response.error)
|
||||
throw Error(response.error);
|
||||
|
||||
.then((response) => {
|
||||
if (response.error) {
|
||||
throw Error(response.error)
|
||||
}
|
||||
document.getElementById("title").textContent = "Done!"
|
||||
document.getElementById("verify").style.display = "none";
|
||||
document.getElementById("verify-success").style.display = "block";
|
||||
|
@ -32,14 +32,13 @@
|
|||
document.getElementById("verify").style.display = "none";
|
||||
document.getElementById("verify-error").style.display = "block";
|
||||
document.getElementById("verify-error-text").textContent = error.message;
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const verifyCallback = response => {
|
||||
var verifyCallback = function(response) {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const email = urlParams.get('email');
|
||||
const temporary_auth_token = urlParams.get('auth_token');
|
||||
const email = urlParams.get('email')
|
||||
const verification_token = urlParams.get('verification_token');
|
||||
// In the future we will have an `origin` query, to smartly redirect (or tell users they are verified)
|
||||
// eg. if origin == "android" and device == "android" open the app, else say "your android app is verified"
|
||||
|
@ -49,8 +48,8 @@
|
|||
document.getElementById("verify").style.display = "block";
|
||||
}
|
||||
|
||||
const expiredCallback = error => {
|
||||
console.log("expired", error);
|
||||
var expiredCallback = function(error) {
|
||||
console.log("expired", error)
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -12,22 +12,18 @@
|
|||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
|
||||
<script>
|
||||
let magicLink = "#";
|
||||
|
||||
const verifyCallback = response => {
|
||||
const payload = btoa(JSON.stringify({
|
||||
var magicLink = "#";
|
||||
var verifyCallback = function(response) {
|
||||
let payload = btoa(JSON.stringify({
|
||||
recaptcha: response,
|
||||
token: "<?php echo $token ?>"
|
||||
}));
|
||||
|
||||
magicLink = "lbry://?verify=" + payload;
|
||||
|
||||
document.getElementById("magic-link-text").textContent = payload;
|
||||
document.getElementById("success").style.display = "block";
|
||||
document.getElementById("captcha-block").style.display = "none";
|
||||
};
|
||||
|
||||
const expiredCallback = () => {
|
||||
var expiredCallback = function() {
|
||||
document.getElementById("success").style.display = "none";
|
||||
document.getElementById("captcha-block").style.display = "block";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue