Enables twitter users to immediately log in to FCC without having to reauthorize the app

pull/36/head
webdev 2015-01-17 17:44:06 -05:00
parent c39e2672fc
commit c90d062f7b
3 changed files with 8 additions and 33 deletions

2
app.js
View File

@ -297,7 +297,7 @@ var passportOptions = {
failureRedirect: '/login'
};
app.get('/auth/twitter', passport.authenticate('twitter'));
app.get('/auth/twitter', passport.authorize('twitter'));
app.get(
'/auth/twitter/callback',
passport.authenticate('twitter', {

View File

@ -14,17 +14,6 @@ var submit = function(code) {
);
};
// prepares the string to be printed on the terminal
var escape = function(msg) {
return msg.
replace(/&/g,'&').
replace(/</g,'&lt;').
replace(/>/g,'&gt;').
replace(/\n/g, '<br/>').
replace(/ /g, '&nbsp;');
};
// puts the message on the terminal
var print = function(cls, msg) {
codeOutput.setValue(msg);
@ -49,17 +38,13 @@ var disconnect = function() {
// interface provided to the plugin
var api = {
output: function(data) {
if (!--requests) {
endLoading();
}
// print('separator');
print('input', data.input);
if (data.error) {
print('message', data.error);
} else {
print('output', data.output);
}
endLoading();
print('input', data.input);
if (data.error) {
print('message', data.error);
} else {
print('output', data.output);
}
}
};
@ -85,15 +70,6 @@ var reset = function() {
setTimeout( function() {
endLoading();
codeOutput.setValue('Infinite loop detected!');
// print('message', 'Your code took too long to execute. Check for an infinite loop or recursion.');
// console.log('infinite loop');
// $('#codeOutput.setValue('Infinite loop detected')')
reset();
}, 10);
});

View File

@ -44,7 +44,6 @@ block content
var editor = myCodeMirror;
myCodeMirror.setValue('2*2');
myCodeMirror.setSize("100%", 500);
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
lineNumbers: false,