From 5e4149e3001f55c9ea60f1b1ba79cc2febc5a121 Mon Sep 17 00:00:00 2001 From: Teoni Valois Date: Fri, 31 Mar 2017 10:58:48 -0300 Subject: [PATCH 01/35] Fixing the authentication check function and enhancing task buttons allowing links to be provided. --- src/components/views/Tasks.vue | 2 +- src/demo.js | 4 +++- src/main.js | 5 +++-- src/routes.js | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/views/Tasks.vue b/src/components/views/Tasks.vue index 5fa1d5d1..461580ed 100644 --- a/src/components/views/Tasks.vue +++ b/src/components/views/Tasks.vue @@ -17,7 +17,7 @@
diff --git a/src/demo.js b/src/demo.js index b561d9b2..a47ec15d 100644 --- a/src/demo.js +++ b/src/demo.js @@ -51,7 +51,9 @@ export const timeline = [{ body: 'Etsy doostang zoodles disqus groupon greplin oooj voxy zoodles, weebly ning heekya handango imeem plugg dopplr jibjab, movity jajah plickers sifteo edmodo ifttt zimbra. Babblely odeo kaboodle quora plaxo ideeli hulu weebly balihoo...', buttons: [{ type: 'primary', - message: 'Read more' + message: 'Read more', + href: 'https://github.com/misterGF/CoPilot', + target: '_blank' }] }, { diff --git a/src/main.js b/src/main.js index 07b3a14e..4b42645d 100644 --- a/src/main.js +++ b/src/main.js @@ -31,8 +31,9 @@ var router = new VueRouter({ // Some middleware to help us ensure the user is authenticated. router.beforeEach((to, from, next) => { - // window.console.log('Transition', transition) - if (to.auth && (to.router.app.$store.state.token === 'null')) { + if (to.matched.some(record => record.meta.requiresAuth) && (!router.app.$store.state.token || router.app.$store.state.token === 'null')) { + // this route requires auth, check if logged in + // if not, redirect to login page. window.console.log('Not authenticated') next({ path: '/login', diff --git a/src/routes.js b/src/routes.js index 3a7c42f7..8192e253 100644 --- a/src/routes.js +++ b/src/routes.js @@ -51,7 +51,7 @@ const routes = [ path: 'server', component: ServerView, name: 'Servers', - meta: {description: 'List of our servers'} + meta: {description: 'List of our servers', requiresAuth: true} }, { path: 'repos', component: ReposView, From 34ff2043d1cfba3bb9afd9ead9e7505b488844f8 Mon Sep 17 00:00:00 2001 From: Teoni Valois Date: Fri, 31 Mar 2017 19:11:27 -0300 Subject: [PATCH 02/35] Fixing more issues related to authentication. One is related to a redirect, and another is related to credentials check upon refresh --- src/components/Login.vue | 2 +- src/main.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Login.vue b/src/components/Login.vue index aa80a550..d418161e 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -81,7 +81,7 @@ export default { window.localStorage.setItem('token', token) } - this.$router.push(data.redirect) + this.$router.push(data.redirect ? data.redirect : '/') } }) .catch(error => { diff --git a/src/main.js b/src/main.js index 4b42645d..4d1d255d 100644 --- a/src/main.js +++ b/src/main.js @@ -46,15 +46,6 @@ router.beforeEach((to, from, next) => { sync(store, router) -// Start out app! -// eslint-disable-next-line no-new -new Vue({ - el: '#root', - router: router, - store: store, - render: h => h(AppView) -}) - // Check local storage to handle refreshes if (window.localStorage) { var localUserString = window.localStorage.getItem('user') || 'null' @@ -65,3 +56,12 @@ if (window.localStorage) { store.commit('SET_TOKEN', window.localStorage.getItem('token')) } } + +// Start out app! +// eslint-disable-next-line no-new +new Vue({ + el: '#root', + router: router, + store: store, + render: h => h(AppView) +}) From 70ef8c94156073e9f8453da37b31caeb7d6f2fb5 Mon Sep 17 00:00:00 2001 From: Gil Ferreira Date: Mon, 22 May 2017 15:24:16 -0400 Subject: [PATCH 03/35] Some enhancements to the logo and how it resizes --- src/components/Dash.vue | 71 +++++++++++++++++++++-------------------- yarn.lock | 14 ++++---- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/components/Dash.vue b/src/components/Dash.vue index ed44d679..49e15d72 100644 --- a/src/components/Dash.vue +++ b/src/components/Dash.vue @@ -1,16 +1,9 @@