feat: auth jwt, permissions, login ui (wip)

This commit is contained in:
Nicolas Giard
2018-10-08 00:17:31 -04:00
parent 563d1a4f98
commit 3abd2f917c
53 changed files with 550 additions and 438 deletions

View File

@@ -1,14 +1,14 @@
<template lang="pug">
v-footer.justify-center(:color='color', inset)
v-footer.justify-center(:color='bgColor', inset)
.caption.grey--text.text--darken-1
span(v-if='company && company.length > 0') {{ $t('common:footer.copyright', { company: company, year: currentYear, interpolation: { escapeValue: false } }) }} |&nbsp;
span {{ $t('common:footer.poweredBy') }} #[a(href='https://wiki.js.org', ref='nofollow') Wiki.js]
v-snackbar(
:color='notification.style'
bottom,
right,
multi-line,
bottom
right
multi-line
v-model='notificationState'
)
.text-xs-left
@@ -21,9 +21,13 @@ import { get, sync } from 'vuex-pathify'
export default {
props: {
altbg: {
type: Boolean,
default: false
color: {
type: String,
default: 'grey lighten-3'
},
darkColor: {
type: String,
default: 'grey darken-3'
}
},
data() {
@@ -36,13 +40,11 @@ export default {
notification: get('notification'),
darkMode: get('site/dark'),
notificationState: sync('notification@isActive'),
color() {
if (this.altbg) {
return 'altbg'
} else if (!this.darkMode) {
return 'grey lighten-3'
bgColor() {
if (!this.darkMode) {
return this.color
} else {
return ''
return this.darkColor
}
}
}

View File

@@ -103,7 +103,7 @@
v-list-tile(href='/p')
v-list-tile-action: v-icon(color='red') person
v-list-tile-title Profile
v-list-tile(href='/logout')
v-list-tile(@click='logout')
v-list-tile-action: v-icon(color='red') exit_to_app
v-list-tile-title Logout
</template>
@@ -111,6 +111,7 @@
<script>
import { get } from 'vuex-pathify'
import _ from 'lodash'
import Cookies from 'js-cookie'
export default {
props: {
@@ -169,6 +170,10 @@ export default {
},
pageDelete () {
},
logout () {
Cookies.remove('jwt')
window.location.assign('/')
}
}
}