Skip to content

Commit a6c2708

Browse files
author
Martin Krulis
committed
Polishing.
1 parent 7691aa8 commit a6c2708

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Sample content of this file is following:
8888
"EXTERNAL_AUTH_URL": "https://some.other.domain/cas/",
8989
"EXTERNAL_AUTH_SERVICE_ID": "id-from-core-api",
9090
"EXTERNAL_AUTH_NAME": {
91-
"cs": "Univerzitní CAS",
92-
"en": "University CAS"
91+
"cs": "Univerzitní login",
92+
"en": "University login"
9393
},
9494
"EXTERNAL_AUTH_HELPDESK_URL": "mailto:[email protected]"
9595
}

etc/env.json.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"EXTERNAL_AUTH_URL": "https://some.other.domain/cas/",
1111
"EXTERNAL_AUTH_SERVICE_ID": "id-from-core-api",
1212
"EXTERNAL_AUTH_NAME": {
13-
"cs": "Univerzitní CAS",
14-
"en": "University CAS"
13+
"cs": "Univerzitní login",
14+
"en": "University login"
1515
},
1616
"EXTERNAL_AUTH_HELPDESK_URL": "mailto:[email protected]"
1717
}

src/containers/ExternalLogin/ExternalLoginBox.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)