Skip to content

Instantly share code, notes, and snippets.

@williamli
Created March 14, 2015 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save williamli/b81cf001966d9da56a3f to your computer and use it in GitHub Desktop.
Save williamli/b81cf001966d9da56a3f to your computer and use it in GitHub Desktop.
Router.route('/login', function () {
if (!Meteor.userId())
{
this.render('login', {
data: function(){
return {is_login: true};
}
});
}
else
{
var intendedDestination = Session.get('intendedDestination');
if (intendedDestination !== undefined)
{
console.log("taking user back to intended destination: "+intendedDestination);
Router.go(intendedDestination);
//Router.go("prize")
//Session.set('intendedDestination', undefined);
}
else
{
// default path
Router.go('home');
}
}
}, {
name: 'login'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment