fix: nope if you are not logged in
This commit is contained in:
@@ -2,12 +2,13 @@ import { FastifyPluginAsync } from 'fastify';
|
|||||||
import { errorHandler, listSettings, version } from '../../../../lib/common';
|
import { errorHandler, listSettings, version } from '../../../../lib/common';
|
||||||
|
|
||||||
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
||||||
fastify.get('/', async () => {
|
fastify.get('/', async (request) => {
|
||||||
|
const teamId = request.user?.teamId;
|
||||||
const settings = await listSettings()
|
const settings = await listSettings()
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
ipv4: settings.ipv4,
|
ipv4: teamId ? settings.ipv4 : 'nope',
|
||||||
ipv6: settings.ipv6,
|
ipv6: teamId ? settings.ipv6 : 'nope',
|
||||||
version,
|
version,
|
||||||
whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true',
|
whiteLabeled: process.env.COOLIFY_WHITE_LABELED === 'true',
|
||||||
whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON,
|
whiteLabeledIcon: process.env.COOLIFY_WHITE_LABELED_ICON,
|
||||||
|
|||||||
Reference in New Issue
Block a user