fixed login and admin evaluation

This commit is contained in:
Timo Volkmann 2019-04-18 12:51:57 +02:00
parent 28be17404d
commit da4bbdeeea
3 changed files with 4 additions and 4 deletions

View File

@ -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')
} }
}, },

View File

@ -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;

View File

@ -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;