2022-10-17 11:28:01 +00:00
|
|
|
import { maybeRedirectToWelcomePage } from '../app/actions.web';
|
|
|
|
import { IStore } from '../app/types';
|
2021-03-24 14:09:40 +00:00
|
|
|
import { hideDialog, openDialog } from '../base/dialog/actions';
|
|
|
|
|
|
|
|
import {
|
|
|
|
CANCEL_LOGIN
|
|
|
|
} from './actionTypes';
|
2022-10-26 06:59:21 +00:00
|
|
|
import LoginDialog from './components/web/LoginDialog';
|
|
|
|
import WaitForOwnerDialog from './components/web/WaitForOwnerDialog';
|
2021-03-24 14:09:40 +00:00
|
|
|
|
2021-04-22 15:05:14 +00:00
|
|
|
export * from './actions.any';
|
|
|
|
|
2021-03-24 14:09:40 +00:00
|
|
|
/**
|
|
|
|
* Cancels {@ink LoginDialog}.
|
|
|
|
*
|
|
|
|
* @returns {{
|
|
|
|
* type: CANCEL_LOGIN
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function cancelLogin() {
|
|
|
|
return {
|
|
|
|
type: CANCEL_LOGIN
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels authentication, closes {@link WaitForOwnerDialog}
|
|
|
|
* and navigates back to the welcome page.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function cancelWaitForOwner() {
|
2022-10-17 11:28:01 +00:00
|
|
|
return (dispatch: IStore['dispatch']) => {
|
2021-03-24 14:09:40 +00:00
|
|
|
dispatch(maybeRedirectToWelcomePage());
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides a authentication dialog where the local participant
|
|
|
|
* should authenticate.
|
|
|
|
*
|
|
|
|
* @returns {Function}.
|
|
|
|
*/
|
|
|
|
export function hideLoginDialog() {
|
|
|
|
return hideDialog(LoginDialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows a notification dialog that authentication is required to create the.
|
2021-04-22 15:05:14 +00:00
|
|
|
* Conference.
|
|
|
|
* This is used for external auth.
|
|
|
|
*
|
|
|
|
* @param {string} room - The room name.
|
|
|
|
* @param {Function} onAuthNow - The function to be invoked when external authentication.
|
2021-03-24 14:09:40 +00:00
|
|
|
*
|
|
|
|
* @returns {Function}.
|
|
|
|
*/
|
2022-10-17 11:28:01 +00:00
|
|
|
export function openAuthDialog(room: String, onAuthNow?: Function) {
|
2021-04-22 15:05:14 +00:00
|
|
|
return openDialog(WaitForOwnerDialog, {
|
|
|
|
room,
|
|
|
|
onAuthNow
|
|
|
|
});
|
2021-03-24 14:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|