mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Added a feature flag to the oauth login feature
issue https://github.com/TryGhost/Team/issues/614 - Makes the feature confiration more similar to other feature flags
This commit is contained in:
parent
84581e9109
commit
a7f47b30b7
3 changed files with 4 additions and 16 deletions
|
@ -8,11 +8,11 @@ import {
|
|||
isRequestEntityTooLargeError,
|
||||
isUnsupportedMediaTypeError
|
||||
} from 'ghost-admin/services/ajax';
|
||||
import {computed, set} from '@ember/object';
|
||||
import {isBlank} from '@ember/utils';
|
||||
import {isArray as isEmberArray} from '@ember/array';
|
||||
import {run} from '@ember/runloop';
|
||||
import {inject as service} from '@ember/service';
|
||||
import {set} from '@ember/object';
|
||||
import {task, timeout} from 'ember-concurrency';
|
||||
|
||||
const {Promise} = RSVP;
|
||||
|
@ -72,10 +72,6 @@ export default Controller.extend({
|
|||
this.yamlAccept = [...this.yamlMimeType, ...Array.from(this.yamlExtension, extension => '.' + extension)];
|
||||
},
|
||||
|
||||
isOAuthEnabled: computed('settings.{oauthClientId,oauthClientSecret}', 'isOAuthConfigurationOpen', function () {
|
||||
return (this.settings.get('oauthClientId') && this.settings.get('oauthClientSecret')) || this.isOAuthConfigurationOpen;
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onUpload(file) {
|
||||
let formData = new FormData();
|
||||
|
|
|
@ -57,6 +57,7 @@ export default Service.extend({
|
|||
emailCardSegments: feature('emailCardSegments', {developer: true}),
|
||||
savedIndicator: feature('savedIndicator', {developer: true}),
|
||||
featureImgDragDrop: feature('featureImgDragDrop', {developer: true}),
|
||||
oauthLogin: feature('oauthLogin', {developer: true}),
|
||||
|
||||
_user: null,
|
||||
|
||||
|
|
|
@ -198,20 +198,11 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="for-switch">
|
||||
<label class="switch" for="settings-oauth">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={{this.isOAuthEnabled}}
|
||||
id="settings-oauth"
|
||||
onclick={{action "toggleIsOAuthEnabled" value="target.checked"}}
|
||||
data-test-private-checkbox
|
||||
>
|
||||
<span class="input-toggle-component"></span>
|
||||
</label>
|
||||
<GhFeatureFlag @flag="oauthLogin" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="gh-expandable-content">
|
||||
{{#if this.isOAuthEnabled}}
|
||||
{{#if this.feature.oauthLogin}}
|
||||
<div class="gh-setting-content-extended gh-labs-sso-settings pt2 pb4">
|
||||
<a href="https://console.developers.google.com/" target="_blank" rel="noopener" class="gh-btn gh-btn-white mb4"><span>{{svg-jar "google-favicon"}}Configure Google OAuth</span></a>
|
||||
<GhFormGroup @class="no-margin pt2" @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="password">
|
||||
|
|
Loading…
Add table
Reference in a new issue