File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,13 @@ class HubSubscription {
1515 let fragmentParams = new URLSearchParams ( location . hash . substring ( 1 ) ) ;
1616 this . _subscriptionData . hubToken = fragmentParams . get ( 'oldLicense' ) ;
1717 if ( this . _subscriptionData . hubToken ) {
18- let base64 = this . _subscriptionData . hubToken . split ( '.' ) [ 1 ] . replace ( / - / g, '+' ) . replace ( / _ / g, '/' ) ;
19- this . _subscriptionData . hubId = JSON . parse ( atob ( base64 ) ) . jti ;
18+ try {
19+ let base64 = this . _subscriptionData . hubToken . split ( '.' ) [ 1 ] . replace ( / - / g, '+' ) . replace ( / _ / g, '/' ) ;
20+ this . _subscriptionData . hubId = JSON . parse ( atob ( base64 ) ) . jti ;
21+ } catch ( e ) {
22+ console . error ( 'Failed to parse hub token:' , e ) ;
23+ this . _subscriptionData . hubToken = null ;
24+ }
2025 }
2126 this . _subscriptionData . hubId = this . _subscriptionData . hubId ?? searchParams . get ( 'hub_id' ) ;
2227 let encodedReturnUrl = fragmentParams . get ( 'returnUrl' ) ?? searchParams . get ( 'return_url' ) ;
You can’t perform that action at this time.
0 commit comments