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

Unable to pass req.isAuthenticated() check in backend api #122

Open
The-Lord-of-Owls opened this issue Sep 23, 2023 · 3 comments
Open

Unable to pass req.isAuthenticated() check in backend api #122

The-Lord-of-Owls opened this issue Sep 23, 2023 · 3 comments

Comments

@The-Lord-of-Owls
Copy link

The-Lord-of-Owls commented Sep 23, 2023

I'm currently working on a react project using a backend api running passport-steam. I'm running into the issue where none of my requests are actually comming back authorized. I'm wondering if you could help point ouf a problem in my code somewhere.

This is the code I'm using for the backend api. However in the frontend when trying to make the fallowing api request: https://pastebin.com/EjnvRpZQ

axios.get( "http://localhost:4000/api/authed" )

I get back the message: 'Unauthorized' that ensureAuthenticated is supposed to return if req.isAuthenticated() returns false. So right of the bat I know that the problem starts with isAuthenticated(), but I can't figure out what exactly I'm missing here in order to get authentication to work right for this

@Bantorbann
Copy link

to test it you have to put in your security key and other required login information

@The-Lord-of-Owls
Copy link
Author

where exactly tho? Cause I've tried going off what was shown here https://www.passportjs.org/packages/passport-steam/

I click login on the front end, it then goes to /api/login for the backend, which then takes me to steam, I then get redirected back to / on the front end. But not authed.

@The-Lord-of-Owls
Copy link
Author

do I need to provide something alongside axios.get and if so what am I providing and how do I get it onto the front end in the first place properly?

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

No branches or pull requests

2 participants