mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app
This commit is contained in:
commit
e575fabff0
5 files changed
+21
-16
No files matched your search
@@ -22,7 +22,10 @@ export default {
|
||||
return {
|
||||
errorUtils,
|
||||
v$: useVuelidate(),
|
||||
form: {},
|
||||
form: {
|
||||
email: 'zachariah.vonrueden@jandl.sk',
|
||||
password: 'testpassword'
|
||||
},
|
||||
showPassword: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,6 +23,12 @@ export default {
|
||||
|
||||
set_employees(state: any, employees: any) {
|
||||
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) {
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
<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" 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">
|
||||
<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>
|
||||
|
||||
@@ -35,8 +35,9 @@ export default {
|
||||
actions: {
|
||||
login({commit}: {commit: any}, credentials: any) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post_data('v1/auth/login', credentials)
|
||||
axios.post('v1/tokens/create', credentials)
|
||||
.then((response: any) => {
|
||||
console.log(response)
|
||||
const token = response.token
|
||||
const user = response.user
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import store from '@/store'
|
||||
/* eslint-disable */
|
||||
import axios from 'axios'
|
||||
import createAuthRefreshInterceptor from 'axios-auth-refresh'
|
||||
import store from '@/store'
|
||||
|
||||
axios.interceptors.request.use(request => {
|
||||
request.headers['Authorization'] = `Bearer ${store.getters['user/token']}`
|
||||
return request
|
||||
})
|
||||
|
||||
const refreshAuthLogic = failedRequest => store.dispatch('user/refreshToken').then(token => {
|
||||
failedRequest.response.config.headers.Authorization = `Bearer ${token}`
|
||||
return Promise.resolve()
|
||||
})
|
||||
|
||||
createAuthRefreshInterceptor(axios, refreshAuthLogic)
|
||||
async function _unauthorised(error: any) {
|
||||
return store.dispatch('auth/logout')
|
||||
}
|
||||
|
||||
axios.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => _unauthorised(error),
|
||||
)
|
||||
Reference in new issue
Block a user