I am making this website with simple picture gallery on it. I am trying to add a simple user authentication on it so only one person can add and remove images from the gallery. I know it probably would be simple to do with PHP but i have never used it so i don't know how simple it actually would be for me? I found out that i can do user authentication in firebase so i thought to try that. So far i have this code:
var ref = new Firebase("https://test.firebaseIO.com");
var authenticate = function(){
ref.authWithPassword({
email: $(".email").val(),
password: $(".password").val()
}, function(error, authData) {
if (error) {
console.log("Something went wrong", error);
} else {
console.log("Authenticated with payload", authData);
}
});
}
$(".login_button").click(function(){
authenticate();
});
I am getting authData back as console log so the authentication is working. Now i am wondering. How can i use this to only show content to the authenticated user? Or is it even possible with authentication like this?
Thank you for your patience.