last day (66 days later) » 

22:37
@Ginger it's going to be something stupid like the fact that I wrote true instead of "true" isn't it? They're string in the python code but my swift code has bools
struct LoginModel: Encodable {
    var email: String
    var password: String
    var fkey: String
    var isSignup = false
    var isLogin = true
    var isPassword = false
    var isAddLogin = false
    var hasCaptcha = false
    var ssrc = "head"
    var submitButton = "Log In"
}

struct LoadModel: Encodable {
    var email: String
    var password: String
    var fkey: String
    var ssrc = "head"
}
nope I'm still seeing the same thing. Screw it, I'm scraping the cookie out of my browser
Just to make sure this isn't the issue are you setting origin and referer headers where necessary
I think that was one thing that got me a few times while reverse engineering the login flow for NPSP
22:54
oh no I'm not
and even if I manually set the cookie I'm not logged in so
@RydwolfPrograms What should I be setting them to?
Oh hang on I think that's just for the websocket
@Bbrk24 What's your user agent string?
I think having a blank UA may have caused me issues at some point
Oh I did notice that sechat set it. It's whatever Alamofire defaults it to, which might be empty
NPSP uses Mozilla/5.0 (compatible; NPSP/2.0; +https://chat.stackexchange.com/rooms/240/the-nineteenth-byte) so something of that format should probably work
Yep, that did it @RydwolfPrograms
23:02
@lyxal TBH the main reason I picked MIT was because I suddenly realized I'd never added a license and I wanted one that wouldn't cause any unintended problems for TIO, ATO, etc.
It still won't give me the cookie if I give it a password, but at least now I can make further requests if I set the cookie in advance
> id: "users"
well that's probably not right
@Bbrk24 duh there's only one @user
I'd recommend HTML parsing with a library over regex for extracting the fkey
I've had bots break a few times from random HTML formatting changes
It's still ignoring my cookie
The top bar URL is https://stackexchange.com/users/login?returnurl=https%3a%2f%2fchat.stackexchange.com%2fchats%2fjoin%2ffavorite which indicates I'm not logged in
Cookie singular? I think you need all of uauth, prov, acct, and sechatusr
23:07
I have prov and acct but not the other two
and actually it was only giving me prov earlier, I'm manually setting acct
why is it not giving me uauth and acct? /srs
In like, the browser?
How about I clone sechat and see if even that works for me
@RydwolfPrograms My Swift code
I'm getting prov but not uauth or acct for some reason
Is the login happening successfully?
You might be getting captcha'd or something?
23:12
It's four requests. The first one goes successfully and sets prov, the next two are successful with no cookies, and then the fourth one is a 404
@RydwolfPrograms No I added a check for that
What's 404ing?
https://\(host)/users/login/universal/request where host is codegolf.stackexchange.com
Yeah that's unnecessary
It's just an extraneous thing from chatbot.py that everyone's cargo culted
Okay then
/users/login-or-signup/validation/track and /users/login both give successful response codes but set no cookies
Remember some cookies are set on redirects
Are you checking the in-between 30Xs for set-cookie headers?
(assuming you're handling cookies manually)
23:14
I tried setting my redirect policy to "do not follow" and I still didn't see any 3xx status codes
and Alamofire is handling cookies
I'm not setting prov manually
Also wait, my browser doesn't even have a uauth cookie
Oh that might not be one that's necessary then
My browser doesn't make a request to /users/login-or-signup/validation/track when I log in
no it does, nevermind
it HAS to be following redirects still because if I assert response code 302 I get "unexpected response code 200"
23:58
Oh it might be the referer header! It sets the referer header to the URL but with an extra query parameter, s=<some GUID>

  last day (66 days later) »