@@ -20,18 +20,18 @@ class ExternalLoginBox extends Component {
2020
2121 constructor ( props ) {
2222 super ( props ) ;
23- this . casWindow = null ;
23+ this . popupWindow = null ;
2424 this . pollPopupClosed = null ;
2525 }
2626
2727 // Handle the messages from our popup window...
2828 messageHandler = e => {
2929 const token = e . data ; // the message should be the external JWT token
3030
31- if ( token !== null && e . source === this . casWindow && this . casWindow !== null ) {
31+ if ( token !== null && e . source === this . popupWindow && this . popupWindow !== null ) {
3232 // cancel the window and the interval
33- this . casWindow . postMessage ( 'received' , e . origin ) ;
34- this . props . login ( token , this . casWindow , error => {
33+ this . popupWindow . postMessage ( 'received' , e . origin ) ;
34+ this . props . login ( token , this . popupWindow , error => {
3535 error . json ( ) . then ( body => {
3636 if ( body && body . error && hasErrorMessage ( body . error ) ) {
3737 this . setState ( { lastError : body . error } ) ;
@@ -43,26 +43,26 @@ class ExternalLoginBox extends Component {
4343 } ;
4444
4545 onClick = ( ) => {
46- if ( this . casWindow === null || this . casWindow . closed ) {
46+ if ( this . popupWindow === null || this . popupWindow . closed ) {
4747 const { url, fail } = this . props ;
4848
49- this . casWindow = openPopupWindow ( url ) ;
50- if ( ! this . casWindow ) {
49+ this . popupWindow = openPopupWindow ( url ) ;
50+ if ( ! this . popupWindow ) {
5151 fail ( ) ; // not in browser or for some reason the window could not have been opened
5252 } else {
5353 // the window is open, now periodically check if the user has already logged in
5454 window . addEventListener ( 'message' , this . messageHandler ) ;
5555 this . pollPopupClosed = window . setInterval ( this . pollPopupClosedHandler , 100 ) ;
5656 }
5757 } else {
58- this . casWindow . focus ( ) ; // no need to create the window again
58+ this . popupWindow . focus ( ) ; // no need to create the window again
5959 }
6060 this . setState ( { pending : true , lastError : null } ) ;
6161 } ;
6262
6363 pollPopupClosedHandler = ( ) => {
6464 // Check, whether the popup has been closed ...
65- if ( ! this . casWindow || this . casWindow . closed === true ) {
65+ if ( ! this . popupWindow || this . popupWindow . closed === true ) {
6666 this . dispose ( ) ;
6767 }
6868 } ;
@@ -78,8 +78,8 @@ class ExternalLoginBox extends Component {
7878 this . pollPopupClosed = null ;
7979 }
8080
81- if ( this . casWindow ) {
82- this . casWindow = null ;
81+ if ( this . popupWindow ) {
82+ this . popupWindow = null ;
8383 }
8484
8585 this . setState ( { pending : false } ) ;
0 commit comments