Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 50 additions & 7 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("User is logged:", response);
alert("User is Logged!");
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -267,9 +269,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("User Name:", response);
alert(response.name);
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -282,9 +286,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("User Email:", response);
alert(response.email);
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -305,6 +311,7 @@ <h2 class="mb-5">Functions</h2>
);
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -325,6 +332,7 @@ <h2 class="mb-5">Functions</h2>
);
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -342,9 +350,11 @@ <h2 class="mb-5">Functions</h2>
)
.then(
function (response) {
console.log("Account created:", response);
alert("Account created succefully!");
},
function (error) {
console.log(error);
alert("Failed to create account");
}
);
Expand All @@ -355,9 +365,11 @@ <h2 class="mb-5">Functions</h2>
function loginAnonymously() {
account.createAnonymousSession().then(
function (response) {
console.log("Anonymous session created:", response);
alert("anonymous session created successfully!");
},
function (error) {
console.log(error);
alert("failed to create session");
}
);
Expand All @@ -372,6 +384,7 @@ <h2 class="mb-5">Functions</h2>
alert("JWT created.");
},
function (error) {
console.log(error);
alert("failed to create session");
}
);
Expand All @@ -387,13 +400,15 @@ <h2 class="mb-5">Functions</h2>
)
.then(
function (response) {
console.log("Session created:", response);
alert("Session created succefully!");
client.subscribe("account", function(response) {
console.log('Received Account event', response);
});

},
function (error) {
console.log(error);
alert("Failed to create session");
}
);
Expand All @@ -416,9 +431,11 @@ <h2 class="mb-5">Functions</h2>
promise.then(
function (response) {
console.log(response); // Success
alert("Google login successful!");
},
function (error) {
console.log(error); // Failure
alert("Google login failed!");
}
);

Expand All @@ -441,9 +458,11 @@ <h2 class="mb-5">Functions</h2>
promise.then(
function (response) {
console.log(response); // Success
alert("Facebook login successful!");
},
function (error) {
console.log(error); // Failure
alert("Facebook login failed!");
}
);

Expand All @@ -466,9 +485,11 @@ <h2 class="mb-5">Functions</h2>
promise.then(
function (response) {
console.log(response); // Success
alert("Github login successful!");
},
function (error) {
console.log(error); // Failure
alert("Github login failed!");
}
);

Expand All @@ -490,9 +511,11 @@ <h2 class="mb-5">Functions</h2>
promise.then(
function (response) {
console.log(response); // Success
alert("Apple login successful!");
},
function (error) {
console.log(error); // Failure
alert("Apple login failed!");
}
);

Expand All @@ -503,12 +526,14 @@ <h2 class="mb-5">Functions</h2>
let promise = account.deleteSessions();

promise.then(
function (response) {
console.log("All session deleted."); // Success
},
function (error) {
console.log(error); // Failure
}
function (response) {
console.log("Sessions deleted:", response);
alert("All sessions deleted."); // Success
},
function (error) {
console.log(error); // Failure
alert("Failed to delete sessions");
}
);

event.preventDefault();
Expand All @@ -519,10 +544,12 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("Current session deleted."); // Success
console.log("Current session deleted:", response);
alert("Current session deleted."); // Success
},
function (error) {
console.log(error); // Failure
alert("Failed to delete current session");
}
);

Expand All @@ -534,9 +561,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("Team created:", response);
alert("Team created."); // Success
},
function (error) {
console.log(error);
alert(error); // Failure
}
);
Expand All @@ -551,9 +580,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("Membership created:", response);
alert("Membership created."); // Success
},
function (error) {
console.log(error);
alert(error); // Failure
}
);
Expand All @@ -569,6 +600,7 @@ <h2 class="mb-5">Functions</h2>
alert("File uploaded successfully");
}, function (error) {
console.log(error); // Failure
alert("Failed to upload file");
});

event.preventDefault();
Expand All @@ -590,8 +622,10 @@ <h2 class="mb-5">Functions</h2>
ul.appendChild(li);
}
console.log(response); // Success
alert("Files listed successfully");
}, function (error) {
console.log(error); // Failure
alert("Failed to list files");
});

event.preventDefault();
Expand All @@ -605,6 +639,7 @@ <h2 class="mb-5">Functions</h2>
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
alert("Failed to get file");
});

event.preventDefault();
Expand All @@ -615,6 +650,7 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("User location:", response);
alert(
"User is from " +
response.country +
Expand All @@ -623,6 +659,7 @@ <h2 class="mb-5">Functions</h2>
);
},
function (error) {
console.log(error);
alert("No User is Logged!");
}
);
Expand All @@ -635,9 +672,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("User IP:", response);
alert("User IP is: " + response.ip);
},
function (error) {
console.log(error);
alert("Failed to get user locale.");
}
);
Expand All @@ -650,13 +689,15 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("EU status:", response);
alert(
response.eu
? "User is a member of the EU"
: "User is not a member of the EU"
);
},
function (error) {
console.log(error);
alert("Failed to get user locale.");
}
);
Expand All @@ -670,9 +711,11 @@ <h2 class="mb-5">Functions</h2>

promise.then(
function (response) {
console.log("Function executed:", response);
alert("Function executed successfully!");
},
function (error) {
console.log(error);
alert("Failed to execute function.");
}
);
Expand Down