Skip to content

Instantly share code, notes, and snippets.

@considine
Last active August 24, 2018 22:36
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 considine/b24715e60e63a8140294f9750048c23a to your computer and use it in GitHub Desktop.
Save considine/b24715e60e63a8140294f9750048c23a to your computer and use it in GitHub Desktop.
redirect to login if no user
const HomeComponent = Vue.component("home-component", {
  template : "<div> \
  <h1> Hello World! </h1> \
  </div>",
  mounted : function () {
    if (!Parse.User.current()) {
      this.$router.replace("/login");
    }
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment