mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
auth methods are now a setting
This commit is contained in:
parent
a44199e247
commit
c8e1d60811
4 changed files with 59 additions and 4 deletions
|
@ -30,9 +30,14 @@
|
|||
}
|
||||
.post-content .post-upvote .upvote-link.voted i.icon-check{
|
||||
/*color: {{getSetting "secondaryColor"}};*/
|
||||
} .logo-image a{
|
||||
max-height:{{getSetting "logoHeight"}}px;
|
||||
max-width:{{getSetting "logoWidth"}}px;
|
||||
}
|
||||
}
|
||||
|
||||
.logo-image a{
|
||||
max-height:{{getSetting "logoHeight"}}px;
|
||||
max-width:{{getSetting "logoWidth"}}px;
|
||||
}
|
||||
|
||||
{{hideAuthClass}}
|
||||
|
||||
</style>
|
||||
</template>
|
|
@ -1,2 +1,27 @@
|
|||
Template[getTemplate('css')].helpers({
|
||||
hideAuthClass: function () {
|
||||
|
||||
var authClass = '';
|
||||
var authMethods = getSetting('authMethods', ["email"]);
|
||||
var selectors = [
|
||||
{name: 'email', selector: ".at-pwd-form"},
|
||||
{name: 'twitter', selector: "#at-twitter"},
|
||||
{name: 'facebook', selector: "#at-facebook"}
|
||||
];
|
||||
selectors.forEach(function (method) {
|
||||
// if current method is not one of the enabled auth methods, hide it
|
||||
if (authMethods.indexOf(method.name) == -1) {
|
||||
authClass += method.selector + ", ";
|
||||
}
|
||||
});
|
||||
|
||||
// unless we're showing at least one of twitter and facebook AND the password form,
|
||||
// hide separator
|
||||
if (authMethods.indexOf('email') == -1 || (authMethods.indexOf('facebook') == -1 && authMethods.indexOf('twitter') == -1)) {
|
||||
authClass += ".at-sep, ";
|
||||
}
|
||||
|
||||
return authClass.slice(0, - 2) + "{display:none !important}";
|
||||
|
||||
}
|
||||
});
|
|
@ -324,6 +324,30 @@ settingsSchemaObject = {
|
|||
group: 'debug',
|
||||
instructions: 'Enable debug mode for more details console logs'
|
||||
}
|
||||
},
|
||||
authMethods: {
|
||||
type: [String],
|
||||
optional: true,
|
||||
autoform: {
|
||||
group: 'auth',
|
||||
editable: true,
|
||||
noselect: true,
|
||||
options: [
|
||||
{
|
||||
value: 'email',
|
||||
label: 'Email/Password'
|
||||
},
|
||||
{
|
||||
value: 'twitter',
|
||||
label: 'Twitter'
|
||||
},
|
||||
{
|
||||
value: 'facebook',
|
||||
label: 'Facebook'
|
||||
}
|
||||
],
|
||||
instructions: 'Authentication methods (default to email only)'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
"debug": "Debug Mode",
|
||||
"fontUrl": "Font URL",
|
||||
"fontFamily": "Font Family",
|
||||
"authMethods": "Authentication Methods",
|
||||
|
||||
// Settings Fieldsets
|
||||
"general": "General",
|
||||
|
|
Loading…
Add table
Reference in a new issue