11// Copyright 2017 Google LLC
2-
2+ //
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
55// You may obtain a copy of the License at
6-
6+ //
77// http://www.apache.org/licenses/LICENSE-2.0
8-
8+ //
99// Unless required by applicable law or agreed to in writing, software
1010// distributed under the License is distributed on an "AS IS" BASIS,
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,13 +21,11 @@ function getStatus() {
2121 if ( response . ok ) {
2222 return response . text ( ) ;
2323 }
24- // [START handle_error]
2524 // [START gae_handle_error]
2625 if ( response . status === 401 ) {
2726 statusElm . innerHTML = 'Login stale. <input type="button" value="Refresh" onclick="sessionRefreshClicked();"/>' ;
2827 }
2928 // [END gae_handle_error]
30- // [END handle_error]
3129 else {
3230 statusElm . innerHTML = response . statusText ;
3331 }
@@ -43,7 +41,6 @@ function getStatus() {
4341getStatus ( ) ;
4442setInterval ( getStatus , 10000 ) ; // 10 seconds
4543
46- // [START refresh_session]
4744// [START gae_refresh_session]
4845var iapSessionRefreshWindow = null ;
4946
@@ -65,7 +62,7 @@ function checkSessionRefresh() {
6562 headers : {
6663 'X-Requested-With' : 'XMLHttpRequest'
6764 }
68- . then ( ( response ) => {
65+ . then ( ( response ) => {
6966 // Checking if browser has a session for the requested app
7067 if ( response . status === 401 ) {
7168 // No new session detected. Try to get a session again
@@ -82,4 +79,3 @@ function checkSessionRefresh() {
8279 }
8380}
8481// [END gae_refresh_session]
85- // [END refresh_session]
0 commit comments