[RN] Don't use webClientId on mobile

That is only required if we'd want our backend to authenticate on behalf of our
users. If the app is to authenticate directly it's not needed.
This commit is contained in:
Saúl Ibarra Corretgé 2018-10-11 15:37:56 +02:00 committed by Zoltan Bettenbuk
parent 8c97ce2ee9
commit 418575136f
4 changed files with 30 additions and 66 deletions

View File

@ -20,12 +20,6 @@ export type Props = {
*/
_conference: Object,
/**
* The ID for the Google client application used for making stream key
* related requests.
*/
_googleApiApplicationClientID: string,
/**
* The current state of interactions with the Google API. Determines what
* Google related UI should display.
@ -279,7 +273,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
* @param {Object} state - The Redux state.
* @returns {{
* _conference: Object,
* _googleApiApplicationClientID: string,
* _googleAPIState: number,
* _googleProfileEmail: string,
* _streamKey: string
@ -288,8 +281,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
export function _mapStateToProps(state: Object) {
return {
_conference: state['features/base/conference'].conference,
_googleApiApplicationClientID:
state['features/base/config'].googleApiApplicationClientID,
_googleAPIState: state['features/google-api'].googleAPIState,
_googleProfileEmail: state['features/google-api'].profileEmail,
_streamKey: state['features/recording'].streamKey

View File

@ -23,12 +23,6 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
*/
type Props = {
/**
* The ID for the Google client application used for making stream key
* related requests.
*/
clientId: string,
/**
* The Redux dispatch Function.
*/
@ -44,12 +38,6 @@ type Props = {
*/
googleResponse: Object,
/**
* The ID for the Google client application used for making stream key
* related requests on iOS.
*/
iOSClientId: string,
/**
* A callback to be invoked when an authenticated user changes, so
* then we can get (or clear) the YouTube stream key.
@ -86,22 +74,11 @@ class GoogleSigninForm extends Component<Props> {
* @inheritdoc
*/
componentDidMount() {
if (!this.props.clientId) {
// NOTE: This is a developer error message, not intended for the
// user to see.
logger.error('Missing clientID');
this._setApiState(GOOGLE_API_STATES.NOT_AVAILABLE);
return;
}
googleApi.hasPlayServices()
.then(() => {
googleApi.configure({
iosClientId: this.props.iOSClientId,
offlineAccess: false,
scopes: [ GOOGLE_SCOPE_YOUTUBE ],
webClientId: this.props.clientId
scopes: [ GOOGLE_SCOPE_YOUTUBE ]
});
googleApi.signInSilently().then(response => {

View File

@ -10,24 +10,13 @@ import { googleApi } from '../../../google-api';
import { setLiveStreamKey } from '../../actions';
import AbstractStartLiveStreamDialog, {
_mapStateToProps as _abstractMapStateToProps,
type Props as AbstractProps
} from './AbstractStartLiveStreamDialog';
import AbstractStartLiveStreamDialog,
{ _mapStateToProps, type Props } from './AbstractStartLiveStreamDialog';
import GoogleSigninForm from './GoogleSigninForm';
import StreamKeyForm from './StreamKeyForm';
import StreamKeyPicker from './StreamKeyPicker';
import styles from './styles';
type Props = AbstractProps & {
/**
* The ID for the Google client application used for making stream key
* related requests on iOS.
*/
_googleApiIOSClientID: string
};
/**
* A React Component for requesting a YouTube stream key to use for live
* streaming of the current conference.
@ -124,8 +113,6 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
return (
<View style = { styles.startDialogWrapper }>
<GoogleSigninForm
clientId = { this.props._googleApiApplicationClientID }
iOSClientId = { this.props._googleApiIOSClientID }
onUserChanged = { this._onUserChanged } />
<StreamKeyPicker
broadcasts = { this.state.broadcasts }
@ -139,20 +126,4 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
}
/**
* Maps part of the Redux state to the component's props.
*
* @param {Object} state - The Redux state.
* @returns {{
* _googleApiApplicationClientID: string
* }}
*/
function _mapStateToProps(state: Object) {
return {
..._abstractMapStateToProps(state),
_googleApiIOSClientID:
state['features/base/config'].googleApiIOSClientID
};
}
export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));

View File

@ -18,12 +18,21 @@ import {
} from '../../../google-api';
import AbstractStartLiveStreamDialog, {
_mapStateToProps,
type Props
_mapStateToProps as _abstractMapStateToProps,
type Props as AbstractProps
} from './AbstractStartLiveStreamDialog';
import StreamKeyPicker from './StreamKeyPicker';
import StreamKeyForm from './StreamKeyForm';
type Props = AbstractProps & {
/**
* The ID for the Google client application used for making stream key
* related requests.
*/
_googleApiApplicationClientID: string
}
/**
* A React Component for requesting a YouTube stream key to use for live
* streaming of the current conference.
@ -340,4 +349,20 @@ class StartLiveStreamDialog
}
}
/**
* Maps part of the Redux state to the component's props.
*
* @param {Object} state - The Redux state.
* @returns {{
* _googleApiApplicationClientID: string
* }}
*/
function _mapStateToProps(state: Object) {
return {
..._abstractMapStateToProps(state),
_googleApiApplicationClientID:
state['features/base/config'].googleApiApplicationClientID
};
}
export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));