I have the following button
<div class="fb-login-button" data-max-rows="1" data-size="large" data-button-type="login_with" data-show-faces="false" data-auto-logout-link="true" data-use-continue-as="false" id="fb-btn" ></div> And the JS code that automatically checks if the user logged in to Facebook on every page load and sends me data.
const $facebookBtn = $('#fb-btn'); $facebookBtn.on('login', this.getDataUserFacebook()); getDataUserFacebook() { FB.login(response => { if (response.status !== 'connected') { console.log(`Not auth, status ${response.status}`); } FB.api('/me?fields=link,id,name,email,birthday,location', (response) => { this.buildProfile(response); }); }); } buildProfile(user) { this.user = { profile_link: user.link, name: user.name, birthday: user.birthday, }; console.log(this.user); } I need to never have the user have the opportunity to immediately be logged in via facebook. I just need to click on the "Login via FB" window to access the application, then the object I needed is formed, and then the exit occurs. And now it happens not by a click, but automatically. What am I doing wrong?