Login Via POST

look at your network tab when you click the join button, you'll see the POST with the data it sends, the response has a Set-Cookie header
E
Ethck1,012d ago
So @kakaroto I've found a POST to the /join endpoint and tested that I can get the same parameters back. I tested via manually sending POST from my browser but it didn't take me into the game world. Am I missing something? Thanks for all the help btw!
LTL
Leo The League Lion1,012d ago
@ethck gave vote LeaguePoints™ to @kakaroto (#12 • 133)
K
KaKaRoTo1,012d ago
The POST wouldn't take you into the world, it would just authenticate you, I think the response also has a Location: header for where you'd be redirected (/game basically) it's not very complicated.. as long as you know the user/pass to login with 🙂 And that's the complicated part, especially since they're hashed now in 0.8.7+
E
Ethck1,012d ago
So in the response I see a redirect: "/game" but no Location header.
K
KaKaRoTo1,012d ago
for integration with something else, I'm not sure how that would work though 😬
E
Ethck1,012d ago
I can figure that part out (eventually) But that won't get far if I can't get into foundry without manually clicking join 🤣
K
KaKaRoTo1,012d ago
humm, yeah, no location in the response 🤷‍♂️
E
Ethck1,012d ago
So do I just get the game page and attach the cookie?
K
KaKaRoTo1,012d ago
1sec I'll open vscode and check
E
Ethck1,012d ago
Thanks!
K
KaKaRoTo1,012d ago
yeah, I manually redirect it the /join handler :
const setCookie = await userManager.login(req.user, req.query.as);
if (setCookie) {
res.append('Set-Cookie', setCookie)
return res.redirect("/game");
}
const setCookie = await userManager.login(req.user, req.query.as);
if (setCookie) {
res.append('Set-Cookie', setCookie)
return res.redirect("/game");
}
E
Ethck1,012d ago
Thanks so much! This will be the first step, but it was likely the primary blocker lol (Pinging just to give you points) @kakaroto
LTL
Leo The League Lion1,012d ago
@ethck gave vote LeaguePoints™ to @kakaroto (#11 • 134)
K
KaKaRoTo1,012d ago
Points! 😍 no problem, good luck!
E
Ethck1,012d ago
Thanks, if it goes well there will be more than a few integrations lol (I've got LDAP in my stack... so... let the nightmares begin)
K
KaKaRoTo1,012d ago
😱 yeah... that sounds fun, lol
E
Ethck1,012d ago
pretty much thisisfine