Guest User

Untitled

a guest
Mar 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <template>
  2. <div>
  3. </div>
  4. </template>
  5.  
  6. <script>
  7. import querystring from "querystring";
  8.  
  9. export default {
  10. name: "LogInCallback",
  11. mounted() {
  12. let hashValue = this.$route.hash;
  13. if (!hashValue) {
  14. this.$router.push("/login"); //after valid login the #token comes back as a hash value no token means user didnt just login
  15. } else {
  16. try {
  17. let tokensString = hashValue.substring(1, hashValue.length); //remove the # in the string
  18. let parsedTokens = querystring.parse(tokensString);
  19. this.$store.commit("account/update_auth_tokens", parsedTokens);
  20. this.$router.push("/");
  21. } catch (e) {
  22. this.$router.push("/login");
  23. }
  24. }
  25. }
  26. };
  27. </script>
  28.  
  29.  
  30. <style>
  31. </style>
Add Comment
Please, Sign In to add comment