Skip to content

Commit

Permalink
bugfix sendRating to VPortal
Browse files Browse the repository at this point in the history
  • Loading branch information
franknitschke committed Mar 5, 2024
1 parent 9d6d4b3 commit 98bc057
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DefaultRefValue {
return this.main.submit && this.left.submit && this.right.submit;
}
get ratingValid() {
if(this.main.valid && this.left.valid && this.right.valid) {
if([this.main.valid, this.left.valid, this.right.valid].filter(rating => rating).length > 1) {
return 'valid'
}else {
return 'invalid'
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ref",
"version": "2.0",
"version": "2.0.1",
"description": "",
"main": "app.js",
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions server/vportal/vportalHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function setVportalUrl() {
}
}

//const vportalUrl = 'https://dev.vportal-online.de';

const vportalUrl = setVportalUrl();
const login = '/account/login';
const getToken = '/auth/token';
Expand Down Expand Up @@ -187,11 +187,10 @@ async function getVportalToken(body) {
body: loginCredentials,
});

//const cookie2 = loginReq.headers.getSetCookie().pop().split(';')[0];
//console.log('Cookie 2: ', cookie2)

const cookieHeader = loginReq.headers.getSetCookie().pop().split(';');
const cookie = cookieHeader.find((el) => el.includes('VPORTAL'));
//console.log('Cookie 1: ', cookie)


const loginTokenReq = await fetch(vportalUrl + getToken, {
method: 'GET',
Expand Down

0 comments on commit 98bc057

Please sign in to comment.