File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 88< body >
99 < script >
1010 'use strict' ;
11+ const defaultPage = '/docs/openapi' ;
1112 function run ( ) {
1213 function deserializeObject ( serialized ) {
1314 const parsedObj = JSON . parse ( serialized ) ;
2324 const code = urlParams . get ( 'code' ) ;
2425 if ( ! code ) {
2526 console . error ( 'Authorization code not found in URL' ) ;
27+ window . location . href = defaultPage ;
2628 return ;
2729 }
2830
5254 } )
5355 . then ( response => {
5456 if ( ! response . ok ) {
55- throw new Error ( 'Token request failed with status ' + response . status ) ;
57+ console . log ( 'Token request failed with status ' + response . status ) ;
58+ window . location . href = defaultPage ;
5659 }
5760 return response . json ( ) ;
5861 } )
5962 . then ( data => {
6063 const accessToken = data . access_token ;
6164 if ( accessToken ) {
6265 localStorage . setItem ( 'access_token' , accessToken ) ;
63- window . location . href = '/docs/openapi' ;
66+ window . location . href = defaultPage ;
6467 }
6568 } )
6669 . catch ( error => {
You can’t perform that action at this time.
0 commit comments