Checks if you are logged in to access protected route, added in login and logout functions against firebase