Enables twitter users to immediately log in to FCC without having to reauthorize the app
parent
c39e2672fc
commit
c90d062f7b
2
app.js
2
app.js
|
@ -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', {
|
||||
|
|
|
@ -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
|
||||
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);
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue