Enables twitter users to immediately log in to FCC without having to reauthorize the app
This commit is contained in:
2
app.js
2
app.js
@ -297,7 +297,7 @@ var passportOptions = {
|
|||||||
failureRedirect: '/login'
|
failureRedirect: '/login'
|
||||||
};
|
};
|
||||||
|
|
||||||
app.get('/auth/twitter', passport.authenticate('twitter'));
|
app.get('/auth/twitter', passport.authorize('twitter'));
|
||||||
app.get(
|
app.get(
|
||||||
'/auth/twitter/callback',
|
'/auth/twitter/callback',
|
||||||
passport.authenticate('twitter', {
|
passport.authenticate('twitter', {
|
||||||
|
@ -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,'<').
|
|
||||||
replace(/>/g,'>').
|
|
||||||
replace(/\n/g, '<br/>').
|
|
||||||
replace(/ /g, ' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// puts the message on the terminal
|
// puts the message on the terminal
|
||||||
var print = function(cls, msg) {
|
var print = function(cls, msg) {
|
||||||
codeOutput.setValue(msg);
|
codeOutput.setValue(msg);
|
||||||
@ -49,17 +38,13 @@ var disconnect = function() {
|
|||||||
// interface provided to the plugin
|
// interface provided to the plugin
|
||||||
var api = {
|
var api = {
|
||||||
output: function(data) {
|
output: function(data) {
|
||||||
if (!--requests) {
|
endLoading();
|
||||||
endLoading();
|
print('input', data.input);
|
||||||
}
|
if (data.error) {
|
||||||
|
print('message', data.error);
|
||||||
// print('separator');
|
} else {
|
||||||
print('input', data.input);
|
print('output', data.output);
|
||||||
if (data.error) {
|
}
|
||||||
print('message', data.error);
|
|
||||||
} else {
|
|
||||||
print('output', data.output);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -85,15 +70,6 @@ var reset = function() {
|
|||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
endLoading();
|
endLoading();
|
||||||
codeOutput.setValue('Infinite loop detected!');
|
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();
|
reset();
|
||||||
}, 10);
|
}, 10);
|
||||||
});
|
});
|
||||||
|
@ -44,7 +44,6 @@ block content
|
|||||||
var editor = myCodeMirror;
|
var editor = myCodeMirror;
|
||||||
myCodeMirror.setValue('2*2');
|
myCodeMirror.setValue('2*2');
|
||||||
myCodeMirror.setSize("100%", 500);
|
myCodeMirror.setSize("100%", 500);
|
||||||
|
|
||||||
|
|
||||||
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
||||||
lineNumbers: false,
|
lineNumbers: false,
|
||||||
|
Reference in New Issue
Block a user