app.js (frontend)
Pocket.init({
providers: ['email','password','google'],
// the default is https://pocketid.app
//url: 'http://localhost:7258'
});
function onSuccess(token) {
console.log("Successful login:");
console.log(token);
window.alert("You're logged in now.");
}
document.querySelector("button").addEventListener("click", function (ev) {
ev.stopPropagation();
ev.preventDefault();
Pocket.token().then(onSuccess).catch(function (e) {
console.error("No token");
console.error(e);
Pocket.signin(onSuccess);
});
});