mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
.
This commit is contained in:
1 parent
1550406534
commit
b52b5114e6
5 files changed
+21
-16
No files matched your search
@@ -22,7 +22,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
errorUtils,
|
errorUtils,
|
||||||
v$: useVuelidate(),
|
v$: useVuelidate(),
|
||||||
form: {},
|
form: {
|
||||||
|
email: 'zachariah.vonrueden@jandl.sk',
|
||||||
|
password: 'testpassword'
|
||||||
|
},
|
||||||
showPassword: false
|
showPassword: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ export default {
|
|||||||
|
|
||||||
set_employees(state: any, employees: any) {
|
set_employees(state: any, employees: any) {
|
||||||
state.employees = employees
|
state.employees = employees
|
||||||
|
|
||||||
|
// TODO: Remove
|
||||||
|
const employee = employees.find(employee => employee.email == 'zachariah.vonrueden@jandl.sk')
|
||||||
|
store.commit('auth/auth_success', {
|
||||||
|
user: employee
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
set_teams(state: any, teams: any) {
|
set_teams(state: any, teams: any) {
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
<template v-slot:event="{ event }">
|
<template v-slot:event="{ event }">
|
||||||
<!-- <div v-if="!event.nonWorking" @click.stop="editTask(event.id)" class="w-100 h-100 d-flex flex-column justify-space-between" :class="{'short-event' : getEventLenght(event) <= 9000000, 'mini-event' : getEventLenght(event) <= 5400000, 'micro-event' : getEventLenght(event) <= 3600000}"> -->
|
<!-- <div v-if="!event.nonWorking" @click.stop="editTask(event.id)" class="w-100 h-100 d-flex flex-column justify-space-between" :class="{'short-event' : getEventLenght(event) <= 9000000, 'mini-event' : getEventLenght(event) <= 5400000, 'micro-event' : getEventLenght(event) <= 3600000}"> -->
|
||||||
<div v-if="!event.nonWorking" class="w-100 h-100 d-flex flex-column justify-space-between" :class="{'short-event' : getEventLenght(event) <= 9000000, 'mini-event' : getEventLenght(event) <= 5400000, 'micro-event' : getEventLenght(event) <= 3600000}">
|
<div v-if="!event.nonWorking" class="w-100 h-100 d-flex flex-column justify-space-between" :class="{'short-event' : getEventLenght(event) <= 9000000, 'mini-event' : getEventLenght(event) <= 5400000, 'micro-event' : getEventLenght(event) <= 3600000}">
|
||||||
<h1>KOKOT</h1>
|
|
||||||
<div class="event-content">
|
<div class="event-content">
|
||||||
<small v-if="(event.subtask.project_code && !event.is_blocker)" class="project-code">{{ event.subtask.project_code }}</small>
|
<small v-if="(event.subtask.project_code && !event.is_blocker)" class="project-code">{{ event.subtask.project_code }}</small>
|
||||||
<h3>{{ event.subtask.master_task?.name || event.subtask.master_task }}</h3>
|
<h3>{{ event.subtask.master_task?.name || event.subtask.master_task }}</h3>
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ export default {
|
|||||||
actions: {
|
actions: {
|
||||||
login({commit}: {commit: any}, credentials: any) {
|
login({commit}: {commit: any}, credentials: any) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.post_data('v1/auth/login', credentials)
|
axios.post('v1/tokens/create', credentials)
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
|
console.log(response)
|
||||||
const token = response.token
|
const token = response.token
|
||||||
const user = response.user
|
const user = response.user
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
import store from '@/store'
|
/* eslint-disable */
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import createAuthRefreshInterceptor from 'axios-auth-refresh'
|
import store from '@/store'
|
||||||
|
|
||||||
axios.interceptors.request.use(request => {
|
async function _unauthorised(error: any) {
|
||||||
request.headers['Authorization'] = `Bearer ${store.getters['user/token']}`
|
return store.dispatch('auth/logout')
|
||||||
return request
|
}
|
||||||
})
|
|
||||||
|
|
||||||
const refreshAuthLogic = failedRequest => store.dispatch('user/refreshToken').then(token => {
|
|
||||||
failedRequest.response.config.headers.Authorization = `Bearer ${token}`
|
|
||||||
return Promise.resolve()
|
|
||||||
})
|
|
||||||
|
|
||||||
createAuthRefreshInterceptor(axios, refreshAuthLogic)
|
|
||||||
|
|
||||||
|
axios.interceptors.response.use(
|
||||||
|
(response) => response,
|
||||||
|
(error) => _unauthorised(error),
|
||||||
|
)
|
||||||
Reference in new issue
Block a user