Просмотр исходного кода

[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.
master
Saúl Ibarra Corretgé 7 лет назад
Родитель
Сommit
418575136f

+ 0
- 9
react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.js Просмотреть файл

@@ -20,12 +20,6 @@ export type Props = {
20 20
      */
21 21
     _conference: Object,
22 22
 
23
-    /**
24
-     * The ID for the Google client application used for making stream key
25
-     * related requests.
26
-     */
27
-    _googleApiApplicationClientID: string,
28
-
29 23
     /**
30 24
      * The current state of interactions with the Google API. Determines what
31 25
      * Google related UI should display.
@@ -279,7 +273,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
279 273
  * @param {Object} state - The Redux state.
280 274
  * @returns {{
281 275
  *     _conference: Object,
282
- *     _googleApiApplicationClientID: string,
283 276
  *     _googleAPIState: number,
284 277
  *     _googleProfileEmail: string,
285 278
  *     _streamKey: string
@@ -288,8 +281,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
288 281
 export function _mapStateToProps(state: Object) {
289 282
     return {
290 283
         _conference: state['features/base/conference'].conference,
291
-        _googleApiApplicationClientID:
292
-            state['features/base/config'].googleApiApplicationClientID,
293 284
         _googleAPIState: state['features/google-api'].googleAPIState,
294 285
         _googleProfileEmail: state['features/google-api'].profileEmail,
295 286
         _streamKey: state['features/recording'].streamKey

+ 1
- 24
react/features/recording/components/LiveStream/GoogleSigninForm.native.js Просмотреть файл

@@ -23,12 +23,6 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
23 23
  */
24 24
 type Props = {
25 25
 
26
-    /**
27
-     * The ID for the Google client application used for making stream key
28
-     * related requests.
29
-     */
30
-    clientId: string,
31
-
32 26
     /**
33 27
      * The Redux dispatch Function.
34 28
      */
@@ -44,12 +38,6 @@ type Props = {
44 38
      */
45 39
     googleResponse: Object,
46 40
 
47
-    /**
48
-     * The ID for the Google client application used for making stream key
49
-     * related requests on iOS.
50
-     */
51
-    iOSClientId: string,
52
-
53 41
     /**
54 42
      * A callback to be invoked when an authenticated user changes, so
55 43
      * then we can get (or clear) the YouTube stream key.
@@ -86,22 +74,11 @@ class GoogleSigninForm extends Component<Props> {
86 74
      * @inheritdoc
87 75
      */
88 76
     componentDidMount() {
89
-        if (!this.props.clientId) {
90
-            // NOTE: This is a developer error message, not intended for the
91
-            // user to see.
92
-            logger.error('Missing clientID');
93
-            this._setApiState(GOOGLE_API_STATES.NOT_AVAILABLE);
94
-
95
-            return;
96
-        }
97
-
98 77
         googleApi.hasPlayServices()
99 78
             .then(() => {
100 79
                 googleApi.configure({
101
-                    iosClientId: this.props.iOSClientId,
102 80
                     offlineAccess: false,
103
-                    scopes: [ GOOGLE_SCOPE_YOUTUBE ],
104
-                    webClientId: this.props.clientId
81
+                    scopes: [ GOOGLE_SCOPE_YOUTUBE ]
105 82
                 });
106 83
 
107 84
                 googleApi.signInSilently().then(response => {

+ 2
- 31
react/features/recording/components/LiveStream/StartLiveStreamDialog.native.js Просмотреть файл

@@ -10,24 +10,13 @@ import { googleApi } from '../../../google-api';
10 10
 
11 11
 import { setLiveStreamKey } from '../../actions';
12 12
 
13
-import AbstractStartLiveStreamDialog, {
14
-    _mapStateToProps as _abstractMapStateToProps,
15
-    type Props as AbstractProps
16
-} from './AbstractStartLiveStreamDialog';
13
+import AbstractStartLiveStreamDialog,
14
+{ _mapStateToProps, type Props } from './AbstractStartLiveStreamDialog';
17 15
 import GoogleSigninForm from './GoogleSigninForm';
18 16
 import StreamKeyForm from './StreamKeyForm';
19 17
 import StreamKeyPicker from './StreamKeyPicker';
20 18
 import styles from './styles';
21 19
 
22
-type Props = AbstractProps & {
23
-
24
-    /**
25
-     * The ID for the Google client application used for making stream key
26
-     * related requests on iOS.
27
-     */
28
-    _googleApiIOSClientID: string
29
-};
30
-
31 20
 /**
32 21
  * A React Component for requesting a YouTube stream key to use for live
33 22
  * streaming of the current conference.
@@ -124,8 +113,6 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
124 113
         return (
125 114
             <View style = { styles.startDialogWrapper }>
126 115
                 <GoogleSigninForm
127
-                    clientId = { this.props._googleApiApplicationClientID }
128
-                    iOSClientId = { this.props._googleApiIOSClientID }
129 116
                     onUserChanged = { this._onUserChanged } />
130 117
                 <StreamKeyPicker
131 118
                     broadcasts = { this.state.broadcasts }
@@ -139,20 +126,4 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
139 126
 
140 127
 }
141 128
 
142
-/**
143
- * Maps part of the Redux state to the component's props.
144
- *
145
- * @param {Object} state - The Redux state.
146
- * @returns {{
147
- *     _googleApiApplicationClientID: string
148
- * }}
149
- */
150
-function _mapStateToProps(state: Object) {
151
-    return {
152
-        ..._abstractMapStateToProps(state),
153
-        _googleApiIOSClientID:
154
-            state['features/base/config'].googleApiIOSClientID
155
-    };
156
-}
157
-
158 129
 export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));

+ 27
- 2
react/features/recording/components/LiveStream/StartLiveStreamDialog.web.js Просмотреть файл

@@ -18,12 +18,21 @@ import {
18 18
 } from '../../../google-api';
19 19
 
20 20
 import AbstractStartLiveStreamDialog, {
21
-    _mapStateToProps,
22
-    type Props
21
+    _mapStateToProps as _abstractMapStateToProps,
22
+    type Props as AbstractProps
23 23
 } from './AbstractStartLiveStreamDialog';
24 24
 import StreamKeyPicker from './StreamKeyPicker';
25 25
 import StreamKeyForm from './StreamKeyForm';
26 26
 
27
+type Props = AbstractProps & {
28
+
29
+    /**
30
+     * The ID for the Google client application used for making stream key
31
+     * related requests.
32
+     */
33
+    _googleApiApplicationClientID: string
34
+}
35
+
27 36
 /**
28 37
  * A React Component for requesting a YouTube stream key to use for live
29 38
  * streaming of the current conference.
@@ -340,4 +349,20 @@ class StartLiveStreamDialog
340 349
     }
341 350
 }
342 351
 
352
+/**
353
+ * Maps part of the Redux state to the component's props.
354
+ *
355
+ * @param {Object} state - The Redux state.
356
+ * @returns {{
357
+ *     _googleApiApplicationClientID: string
358
+ * }}
359
+*/
360
+function _mapStateToProps(state: Object) {
361
+    return {
362
+        ..._abstractMapStateToProps(state),
363
+        _googleApiApplicationClientID:
364
+        state['features/base/config'].googleApiApplicationClientID
365
+    };
366
+}
367
+
343 368
 export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));

Загрузка…
Отмена
Сохранить