Changes ANONYMOUS dynamic variable
This commit is contained in:
commit
213af0cfa3
@ -22,6 +22,7 @@ MAX_USERNAME_LENGTH=8
|
||||
OPID_CLIENT_ID=
|
||||
OPID_CLIENT_SECRET=
|
||||
OPID_CLIENT_ISSUER=
|
||||
DISABLE_ANONYMOUS=
|
||||
|
||||
# If you want to have a contact page in your menu, you MUST set CONTACT_URL to the URL of the page that you want
|
||||
CONTACT_URL=
|
@ -70,6 +70,7 @@ services:
|
||||
OPID_CLIENT_ID: $OPID_CLIENT_ID
|
||||
OPID_CLIENT_SECRET: $OPID_CLIENT_SECRET
|
||||
OPID_CLIENT_ISSUER: $OPID_CLIENT_ISSUER
|
||||
DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS
|
||||
volumes:
|
||||
- ./pusher:/usr/src/app
|
||||
labels:
|
||||
|
@ -71,6 +71,7 @@ services:
|
||||
OPID_CLIENT_ID: $OPID_CLIENT_ID
|
||||
OPID_CLIENT_SECRET: $OPID_CLIENT_SECRET
|
||||
OPID_CLIENT_ISSUER: $OPID_CLIENT_ISSUER
|
||||
DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS
|
||||
volumes:
|
||||
- ./pusher:/usr/src/app
|
||||
labels:
|
||||
|
@ -5,7 +5,7 @@ import { adminApi } from "../Services/AdminApi";
|
||||
import { AuthTokenData, jwtTokenManager } from "../Services/JWTTokenManager";
|
||||
import { parse } from "query-string";
|
||||
import { openIDClient } from "../Services/OpenIDClient";
|
||||
import { DISABLE_ANONYMOUS } from "_Enum/EnvironmentVariable";
|
||||
import { DISABLE_ANONYMOUS } from "../Enum/EnvironmentVariable";
|
||||
|
||||
export interface TokenInterface {
|
||||
userUuid: string;
|
||||
|
@ -175,12 +175,13 @@ export class IoSocketController {
|
||||
|
||||
const tokenData =
|
||||
token && typeof token === "string" ? jwtTokenManager.verifyJWTToken(token) : null;
|
||||
const userIdentifier = tokenData ? tokenData.identifier : "";
|
||||
|
||||
if (DISABLE_ANONYMOUS && !tokenData) {
|
||||
throw new Error("Expecting token");
|
||||
}
|
||||
|
||||
const userIdentifier = tokenData ? tokenData.identifier : "";
|
||||
|
||||
let memberTags: string[] = [];
|
||||
let memberVisitCardUrl: string | null = null;
|
||||
let memberMessages: unknown;
|
||||
|
Loading…
Reference in New Issue
Block a user