Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:20:51+00:00 2026-06-02T17:20:51+00:00

I have a ‘Sign in with Facebook’ button that generates a popup which asks

  • 0

I have a ‘Sign in with Facebook’ button that generates a popup which asks the user to enter FB credentials.

In the case where the user has already joined my app, left the app and then comes back (while still logged into Facebook), I’d like the user to be able to click ‘sign in with Facebook’ and not show the popup.

At the moment, given the situation in the paragraph above, the popup opens for a second and then the page redirects to the logged in state of the app.

I’ve implemented the following code below – I’m a complete noob when it comes to Javascript so whilst the answer might be obvious I don’t know what to do!

window.fbAsyncInit = function() {
     FB.init({
       appId  : '372191216164729',
       status : true, // check login status
       cookie : true, // enable cookies to allow the server to access the session
       xfbml  : true  // parse XFBML
     });
   };

   (function(d) {
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));

   $(function() {
     $('#fb_connect').click(function(e) {
       e.preventDefault();

       FB.login(function(response) {                    
         if (response.authResponse) {
           // $('#connect').html('Connected! Hitting OmniAuth callback (GET /auth/facebook/callback)...');

                    //this might not be the best way to do this ...
                    $('#welcome_form').submit();
           // since we have cookies enabled, this request will allow omniauth to parse
           // out the auth code from the signed request in the fbsr_XXX cookie
           // $.getJSON('/auth/facebook/callback', function(json) {
           //             $('#connect').html('Connected! Callback complete.');
           //             $('#results').html(JSON.stringify(json));
           //           });
         }
       }, { scope: 'email, read_stream' });
     });
   });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:20:53+00:00Added an answer on June 2, 2026 at 5:20 pm

    When the page loads, after you then load and initialize the fb sdk use the FB.getLoginStatus method to check the user status.
    If the user is already logged in and authorized your app then the response should have the access token, user id, etc.

    For example:

    FB.getLoginStatus(function(response) {
        if (response.status === "connected") {
            // use the response.authResponse
        }
        else if (response.status === "not_authorized") {
            FB.login(function(response) {
                ...
            }, { scope: "email, read_stream" });
        }
        else {
            // user not logged in to facebook
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that
Have a group of related projects running in SQL Server 2005 for which I
Have some dates in my local Oracle 11g database that are in this format:
Have any one tried to activate fancybox thumbnail gallery using a button or an
Have anyone used Redmine Documentor which lets you convert PHP to HTML to Redmine
Have the following scenario. I have a few form, which essentially have a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.