fixed login and admin evaluation
This commit is contained in:
parent
28be17404d
commit
da4bbdeeea
@ -107,7 +107,7 @@ module.exports = function (ctx) {
|
|||||||
API: JSON.stringify('http://localhost:8080')
|
API: JSON.stringify('http://localhost:8080')
|
||||||
}
|
}
|
||||||
: { // Base URL for API-Calls: PRODUCTION (build)
|
: { // Base URL for API-Calls: PRODUCTION (build)
|
||||||
//API: JSON.stringify('http://se.hs-heilbronn.de:8090')
|
//API: JSON.stringify('http://se.hs-heilbronn.de:8090/buga19geocaching')
|
||||||
API: JSON.stringify('http://localhost:8080')
|
API: JSON.stringify('http://localhost:8080')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -132,7 +132,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
startCache(cacheID) {
|
startCache(cacheID) {
|
||||||
const userToken = JSON.parse(localStorage.getItem('userToken'));
|
const userToken = JSON.parse(localStorage.getItem('userToken')).token;
|
||||||
let params = {cacheID: cacheID};
|
let params = {cacheID: cacheID};
|
||||||
if (userToken != null) {
|
if (userToken != null) {
|
||||||
params.token = userToken;
|
params.token = userToken;
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
export function GET_ADMINSTATE(state) {
|
export function GET_ADMINSTATE(state) {
|
||||||
console.log("GET_ADMINSTATE()");
|
console.log("GET_ADMINSTATE()");
|
||||||
if (state.userAuthenticated !== null) {
|
if (state.userAuthenticated !== null) {
|
||||||
console.log(state.userAuthenticated.roles.find(x => x.name === "admin") != null);
|
console.log(state.userAuthenticated.roles.find(x => x.name === "ADMIN") != null);
|
||||||
return state.userAuthenticated.roles.find(x => x.name === "admin") != null;
|
return state.userAuthenticated.roles.find(x => x.name === "ADMIN") != null;
|
||||||
} else {
|
} else {
|
||||||
console.log(state.userAuthenticated);
|
console.log(state.userAuthenticated);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user