Skip to content

Instantly share code, notes, and snippets.

@ralphbean
Created February 9, 2012 13:42
Show Gist options
  • Save ralphbean/1780093 to your computer and use it in GitHub Desktop.
Save ralphbean/1780093 to your computer and use it in GitHub Desktop.
tg2app/public/js/auth-faked.js
(function() {
var check_auth, globals;
globals = typeof exports !== "undefined" && exports !== null ? exports : this;
globals.logged_in_callback = function(user) {
return window.location = '/do_login?' + $.param({
name: user.name,
access_token: globals.access_token
});
};
check_auth = function() {
var faked_user;
if (window.location.href.indexOf('waiting') !== -1) return;
globals.access_token = "foobarlol";
faked_user = {
name: 'Big Bird'
};
return globals.logged_in_callback(faked_user);
};
$(document).ready(check_auth);
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment