Skip to content

Commit

Permalink
Merge pull request #29 from saaltech/feature/webapp-branding
Browse files Browse the repository at this point in the history
clear flow for host versus guest
  • Loading branch information
neehalsaal committed Jul 6, 2020
2 parents cb37d08 + fd0891d commit 5b2a09b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions lang/main-ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"incorrectRoomLockPassword": "",
"incorrectPassword": "",
"invalidHost": "Sorry, You cannot host this meeting. Please wait for the host to join.",
"guestErrorMessage": "Please wait for the host to join.",
"inlineInstallationMsg": "",
"inlineInstallExtension": "",
"internalError": "",
Expand Down
1 change: 1 addition & 0 deletions lang/main-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"incorrectRoomLockPassword": "Incorrect password",
"incorrectPassword": "Incorrect username or password",
"invalidHost": "Sorry, You cannot host this meeting. Please wait for the host to join.",
"guestErrorMessage": "Please wait for the host to join.",
"inlineInstallationMsg": "You need to install our desktop sharing extension.",
"inlineInstallExtension": "Install now",
"internalError": "Oops! Something went wrong. The following error occurred: {{error}}",
Expand Down
1 change: 1 addition & 0 deletions lang/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"incorrectRoomLockPassword": "Incorrect password",
"incorrectPassword": "Incorrect username or password",
"invalidHost": "Sorry, You cannot host this meeting. Please wait for the host to join.",
"guestErrorMessage": "Please wait for the host to join.",
"inlineInstallationMsg": "You need to install our desktop sharing extension.",
"inlineInstallExtension": "Install now",
"internalError": "Oops! Something went wrong. The following error occurred: {{error}}",
Expand Down
18 changes: 13 additions & 5 deletions modules/UI/authentication/AuthHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ function initJWTTokenListener(room) {
*/
function doXmppAuth (room, lockPassword) {
let participantType = window.sessionStorage.getItem("participantType");
let hostUsername = window.sessionStorage.getItem("hostUsername") || "";
let hostPassword = window.sessionStorage.getItem("hostPassword") || "";
let hostUsername = participantType == "host" ?
(window.sessionStorage.getItem("hostUsername") || "") : "";
let hostPassword = participantType == "host" ?
(window.sessionStorage.getItem("hostPassword") || "") : "";

const { showPrejoin } = APP.store.getState()['features/prejoin'];
if(showPrejoin) {
Expand Down Expand Up @@ -235,6 +237,10 @@ function doXmppAuth (room, lockPassword) {
_setInterimPrejoinPage(true)

// Show error on the page
if(participantType == 'guest') {
error.connectionError = "dialog.guestErrorMessage"
}

_setPrejoinPageErrorMessage(error)

}).catch(error => {
Expand All @@ -247,9 +253,9 @@ function doXmppAuth (room, lockPassword) {
}
)
}
else {
oldLoginFlow(room, lockPassword)
}
// else {
// oldLoginFlow(room, lockPassword)
// }
}

function oldLoginFlow(room, lockPassword) {
Expand Down Expand Up @@ -313,6 +319,8 @@ function _setPrejoinPageErrorMessage(error) {
// this is a CONFERENCE_HOST_NOT_AUTHORIZED error, as login window was already
// open once, this means username or password does not match that of the host.
messageKey = 'dialog.invalidHost';
} else if (errorKey) {
messageKey = errorKey
}

APP.store.dispatch(setPrejoinPageErrorMessageKey(messageKey))
Expand Down
8 changes: 6 additions & 2 deletions react/features/prejoin/components/Prejoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ class Prejoin extends Component<Props, State> {
isHost: false,
participantTypeOptionSpecified: false,
hostUsername: window.sessionStorage.getItem('hostUsername') || '',
hostPassword: window.sessionStorage.getItem('hostPassword') || ''
hostPassword: window.sessionStorage.getItem('hostPassword') || '',
roomPassword: ''
});
}

Expand Down Expand Up @@ -254,7 +255,8 @@ class Prejoin extends Component<Props, State> {
* @param {*} roomPassword
*/
_setRoomPassword(roomPassword) {
window.sessionStorage.setItem('roomPassword', roomPassword);
//window.sessionStorage.setItem('roomPassword', roomPassword);
this.setFieldInState('roomPassword', roomPassword);
}

setFieldInState(field, value) {
Expand All @@ -267,7 +269,9 @@ class Prejoin extends Component<Props, State> {
_setDetailsToStore() {
window.sessionStorage.setItem('hostUsername', this.state.hostUsername);
window.sessionStorage.setItem('hostPassword', this.state.hostPassword);
window.sessionStorage.setItem('roomPassword', this.state.roomPassword);
window.sessionStorage.setItem('participantType', this.state.participantType);

}

_closeDialog: () => void;
Expand Down

0 comments on commit 5b2a09b

Please sign in to comment.