Beispiel #1
0
 private static function handleLogin()
 {
     if (!isset($_POST['login'])) {
         return;
     }
     $user = new User($_POST['user'], $_POST['pass']);
     $cookies = Net::startSession();
     $user->setCaptcha($_POST['gid'] ?: -1, $_POST['captcha'] ?: '')->setEmailSteamId($_POST['emailsteamid'] ?: '')->setTwoFactorCode($_POST['2fa'] ?: '');
     $loginData = $user->doLogin($cookies);
     if (!$loginData['success']) {
         return $loginData;
     }
     $hasPhone = $loginData['oauth']->hasPhone();
     if (!$hasPhone) {
         return ['phone_needed' => true];
     }
     $authData = $loginData['oauth']->addAuthenticator();
     $authData = array_merge($authData, ['access_token' => $loginData['oauth']->oauth_token, 'wgtoken' => $loginData['oauth']->wgtoken, 'wgtoken_secure' => $loginData['oauth']->wgtoken_secure, 'steamid' => $loginData['oauth']->steamid]);
     return ['sms_needed' => true, 'revocation_code' => $authData['revocation_code'], 'authdata' => Crypt::encrypt($authData, $_POST['ekey']), 'raw' => $authData];
 }