Enabled Json Web Token authorisation on backend, and frontend

This commit is contained in:
Nedim Uka
2018-07-24 17:28:24 +02:00
parent 03963d6056
commit 1f6b1043a4
34 changed files with 7539 additions and 2625 deletions

View File

@@ -9,12 +9,16 @@ const getAuthLocalToken = () => {
return localStorage.accessToken || '';
}
const defaultParams = () =>({
const defaultParams = () => ({
method: 'get',
responseType: 'json',
headers: {
Authorization: 'Bearer ' + getAuthLocalToken()
}
headers: getAuthLocalToken() !== '' ?
{
Authorization: 'Bearer ' + getAuthLocalToken()
} :
{
}
});
const uploadParams = () =>({