liamcurry/passport-steam

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

The-Lord-of-Owls opened this issue · 3 comments

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

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

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.

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?