Skip to content

Commit 145ba63

Browse files
Use prepended version
1 parent 819cc94 commit 145ba63

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

server/routers/badger/verifySession.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import semver from "semver";
3737
import { APP_VERSION } from "@server/lib/consts";
3838
import { enforceResourceSessionLength } from "@server/lib/checkOrgAccessPolicy";
3939

40+
const APP_VERSION_PREPEND = `remote-${APP_VERSION}`;
41+
4042
// We'll see if this speeds anything up
4143
const cache = new NodeCache({
4244
stdTTL: 5 // seconds
@@ -855,7 +857,11 @@ async function notAllowed(
855857
}
856858

857859
const data = {
858-
data: { valid: false, redirectUrl, pangolinVersion: APP_VERSION },
860+
data: {
861+
valid: false,
862+
redirectUrl,
863+
pangolinVersion: APP_VERSION_PREPEND
864+
},
859865
success: true,
860866
error: false,
861867
message: "Access denied",
@@ -869,8 +875,12 @@ function allowed(res: Response, userData?: BasicUserData) {
869875
const data = {
870876
data:
871877
userData !== undefined && userData !== null
872-
? { valid: true, ...userData, pangolinVersion: APP_VERSION }
873-
: { valid: true, pangolinVersion: APP_VERSION },
878+
? {
879+
valid: true,
880+
...userData,
881+
pangolinVersion: APP_VERSION_PREPEND
882+
}
883+
: { valid: true, pangolinVersion: APP_VERSION_PREPEND },
874884
success: true,
875885
error: false,
876886
message: "Access allowed",
@@ -911,7 +921,7 @@ async function headerAuthChallenged(
911921
headerAuthChallenged: true,
912922
valid: false,
913923
redirectUrl,
914-
pangolinVersion: APP_VERSION
924+
pangolinVersion: APP_VERSION_PREPEND
915925
},
916926
success: true,
917927
error: false,

0 commit comments

Comments
 (0)