Created
March 14, 2015 15:27
-
-
Save williamli/b81cf001966d9da56a3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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