Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localhost refused to connect. #86

Open
LiladharSapkota790 opened this issue Mar 9, 2022 · 6 comments
Open

localhost refused to connect. #86

LiladharSapkota790 opened this issue Mar 9, 2022 · 6 comments
Labels
question Request for help or support

Comments

@LiladharSapkota790
Copy link

** READ THIS FIRST! **

Are you looking for help?

Reminder: The issue tracker is not a support forum.

Issues should only be filed in this project once they are able to be reproduced
and confirmed as a flaw in the software or incorrect information in associated
documention.

If you are encountering problems integrating this module into your application,
please post a question on the discussion forum
rather than filing an issue.

Is this a security issue?

Do not open issues that might have security implications. Potential security
vulnerabilities should be reported privately to jaredhanson@gmail.com. Once any
vulerabilities have been repaired, the details will be disclosed publicly in a
responsible manner. This also allows time for coordinating with affected parties
in order to mitigate negative consequences.

If neither of the above two scenarios apply to your situation, you should open
an issue. Delete this paragraph and the text above, and fill in the information
requested below.

Expected behavior

Actual behavior

Steps to reproduce

// Format code using Markdown code blocks

Environment

  • Operating System:
  • Node version:
  • passport version:
  • passport-google-oauth2 version:
@LiladharSapkota790
Copy link
Author

"passport": "^0.5.2",
"passport-google-oauth20": "^2.0.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^6.1.0"

when I tried to login with google account it shows localhost refused to connect and show no error at other places.

@jaredhanson
Copy link
Owner

It's not clear from the information provided that this issue is related to passport. Could you post a screenshot of the error or stack traces from the code?

@jaredhanson jaredhanson added the question Request for help or support label Mar 9, 2022
@ronaldgevern
Copy link

Generally this happens when the service running on your localhost has some problem resolving the request. If you have access to logs, please see logs for more details on the error. Also, make sure the application interface, server, and services are running. There are many situations that might trigger “this site can't be reached” error in browsers. Sometimes the server is still running but the interface application is closed or the database is down. If your application interface and server is up but a dependent service is down then restart your computer/server and restart services. Make sure the app is bound to localhost. It may just be bound to an individual interface. netstat -na will give you the clues you need. Run a port scan on your computer and make sure the port is opened.

The problem may happens for failing on DNS lookup . DNS is that network address that translates the website name to its internet address. Most often it causes for not getting the internet connection or misconfigured internet or network settings. Another reason could be the firewall preventing Google Chrome to load the webpage. However, other reasons, such as insufficient permissions or the Apache web server not running properly might also cause the error.

@belanasaikiran
Copy link

In case, if you've written the function this way

app.get('/auth/google', (req, res) => {
  passport.authenticate('google', {
    scope: ['profile', 'email']
  });
});

change it to:

app.get('/auth/google', 
  passport.authenticate('google', {
    scope: ['profile', 'email']
  })
);

I made the same mistake and then re-checked the documentation and cleared this error.

Thanks

@PRIYANSHURAJROY4U
Copy link

In case, if you've written the function this way

app.get('/auth/google', (req, res) => {
  passport.authenticate('google', {
    scope: ['profile', 'email']
  });
});

change it to:

app.get('/auth/google', 
  passport.authenticate('google', {
    scope: ['profile', 'email']
  })
);

I made the same mistake and then re-checked the documentation and cleared this error.

Thanks

thanks a lot for this info, I too made the same mistake

@TENSHKUMAR-KKT-2004
Copy link

In case, if you've written the function this way

app.get('/auth/google', (req, res) => {
  passport.authenticate('google', {
    scope: ['profile', 'email']
  });
});

change it to:

app.get('/auth/google', 
  passport.authenticate('google', {
    scope: ['profile', 'email']
  })
);

I made the same mistake and then re-checked the documentation and cleared this error.

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or support
Projects
None yet
Development

No branches or pull requests

6 participants