Skip to content

Commit

Permalink
Add support for readonlytext config item. Add callback URLs for authe…
Browse files Browse the repository at this point in the history
…ntications. Fix facebook auth. Disable auth debugging.
  • Loading branch information
richtera committed Oct 14, 2012
1 parent 129c1d4 commit 9cad4ec
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 65 deletions.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ var rootpath = process.cwd() + '/',
logo = require(path.join(rootpath, 'logo')),
everyauth = require("everyauth");

everyauth.debug = true;
// To enable everyauth debugging.
//everyauth.debug = true;

everyauth.everymodule
.findUserById( function (req, id, callback) {
Expand Down
15 changes: 13 additions & 2 deletions lib/core/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ me.decorateField = function(field, tagHTML){
+ '">' + t(field.label) + (isCheckable ? '' : ':') + '</label>'
) : '';

var wrapperId = (
var wrapperId = field.name ? (
field.name.replace(/\[/g, '_').replace(/\]/g, '')
+ (field.type == 'radio' ? '-radio' + me.radioCount : '')
);
) : '';

return field.label && field.label.length > 0 ? (
'<div class="form-item field-type-' + field.type + '" id="' + wrapperId + '-wrapper">' +
Expand Down Expand Up @@ -488,6 +488,17 @@ me.elementTypes = {
}
},

'readonlytext': {
render: function(field, value, bare){
var id = field.id || field.name;
var text = field.text || field.value;
var tagOutput = '<div class="readonlytext text' + (field.cls ? ' ' + field.cls : "") + '"'
+ (id ? ' id="' + id + '"' : '')
+ '>' + text + '</div>';
return bare ? tagOutput : me.decorateField(field, tagOutput);
}
},

'date': {
render: function(field, value, bare){

Expand Down
12 changes: 12 additions & 0 deletions modules/core/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,12 @@ function coreConfig(req, res, template, block, next) {
description:'ClientSecret for this application to allow google authentication',
name:'server:authentication:googleClientSecret',
type:'password'
},
{
label:'Google Callback',
description:'Callback URL for google authentication',
type:'readonlytext',
value: calipso.config.get('server:url') + '/auth/google/callback'
}
]
},
Expand All @@ -784,6 +790,12 @@ function coreConfig(req, res, template, block, next) {
description:'ConsumerSecret for this application to allow twitter authentication',
name:'server:authentication:twitterConsumerSecret',
type:'password'
},
{
label:'Twitter Callback',
description:'Callback URL for twitter authentication',
type:'readonlytext',
value: calipso.config.get('server:url') + '/auth/twitter/callback'
}
]
}
Expand Down
Loading

0 comments on commit 9cad4ec

Please sign in to comment.