fix: nope in database strings
This commit is contained in:
@@ -2,21 +2,14 @@ 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.addHook('onRequest', async (request) => {
|
fastify.addHook('onRequest', async (request) => await request.jwtVerify());
|
||||||
try {
|
|
||||||
return await request.jwtVerify();
|
|
||||||
} catch(error){
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
fastify.get('/', async (request) => {
|
fastify.get('/', async (request) => {
|
||||||
const teamId = request.user?.teamId;
|
const teamId = request.user?.teamId;
|
||||||
const settings = await listSettings()
|
const settings = await listSettings()
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
ipv4: teamId ? settings.ipv4 : 'nope',
|
ipv4: teamId ? settings.ipv4 : null,
|
||||||
ipv6: teamId ? settings.ipv6 : 'nope',
|
ipv6: teamId ? settings.ipv6 : null,
|
||||||
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