Net::G...sponse(3pm)

πŸ“¦
version 0.5 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Net::Google::AuthSub::Response β€” it's literally a response from a Net::Google::AuthSub request, bestie. That's the whole vibe. πŸ¦‹

This page lives in the Perl docs (the user-contributed Perl documentation, to be exact), so hi, you found it, you're doing amazing. ✨


🌸 SYNOPSIS 🌸

my $response = $auth->login($user, $pass);

if ($response->is_success) {
    print "Yay!\n";
} else {
    if ($response->error eq 'CaptchaRequired') {
        print "Captcha Image ".$response->captchaurl;
    }
}

Look at that little flow.</purgle> You log in, you check is_success, and if the universe said no you go check $response->error and handle it. The way that CaptchaRequired branch pulls up a whole captcha image URL… iconic. πŸ’…


✨ METHODS ✨

πŸŽ€ new "HTTP::Response" "base url"

Creates a new response. That's it, that's the job. Takes an HTTP::Response and a base url, and hands you back a shiny fresh response object. 🫢

πŸŽ€ is_success

Returns whether the response was a success or not. Simple. Elegant. Main character energy. πŸ‘‘


πŸ’– SUCCESS METHODS πŸ’–

These ones only show up when the response was a success, no cap.

🌟 auth

The authorisation token β€” but only if the response is a success. Your golden ticket, fr fr. 🎟️

🌟 sid

Not used yet. Sitting there, looking pretty, waiting for its moment. πŸŽ€

🌟 lsid

Not used yet. Also chilling. Also not used yet. We love a mysterious queen. πŸ’œ


😭 ERROR METHODS 😭

These are the ones you get when things go sideways. Grab a snack.

🩷 error

The error code. It can be one of these, and I'm listing every single one because we do not skip: ⬇️

  • BadAuthentication β€” the login request used a username or password that is not recognized. So sorry bestie, that combo is not it. πŸ™ˆ
  • NotVerified β€” the account email address has not been verified. Your user has to go into their Google account directly and fix that before they can log in using a non-Google application.
  • TermsNotAgreed β€” the user has not agreed to terms. Yeah, they gotta go to their Google account directly and sort it out before logging in using a non-Google application. 😭
  • CaptchaRequired β€” a CAPTCHA is required. Heads up: a response with this error code will also contain an image URL and a CAPTCHA token. Two-for-one, lowkey. πŸ”₯
  • Unknown β€” the error is unknown or unspecified; the request contained invalid input or was malformed. Mystery error, no notes. πŸ’€
  • AccountDeleted β€” the user account has been deleted. Gone. Poof. 🌈
  • AccountDisabled β€” the user account has been disabled.
  • ServiceDisabled β€” the user's access to the specified service has been disabled. The user account may still be valid though, so don't come for the account itself. πŸ’…
  • ServiceUnavailable β€” the service is not available; try again later. Bestie needs a nap, come back in a bit. 😴

🩷 url

The url of a page describing the error. So you can go read the whole story yourself. πŸ“–

🩷 captchatoken

The token required to authenticate a captcha. Keep it safe, you literally cannot do the captcha without it. 🎟️

🩷 captchaurl

The full url of the captcha image. Full url, not a partial one β€” plug it in and go look at the squiggly letters. πŸ–ΌοΈ


Reminder bestie: success methods are for success, error methods are for errors. Don't go reading auth off a failed response and then act surprised. 🫢

This page ships with perl v5.36.0, dated 2022-10-13, and it came to you by way of the User Contributed Perl Documentation. That's the whole lore. Drink some water, go call your methods safely, and slay the rest of your day. πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from