sanitize aliases response, hide delete button for non-prefereable domain aliases
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
2023-08-05 15:01:37 +03:00
parent fcb5780ef9
commit cc453e2337
5 changed files with 130 additions and 58 deletions

View File

@@ -1,3 +1,4 @@
import { randomUUID } from "crypto";
import { feathers } from "@feathersjs/feathers";
import express, {
rest,
@@ -16,12 +17,11 @@ import RedisStore from "connect-redis";
import { createClient } from "redis";
import config from "config";
import type { Application } from "./declarations";
import { logger } from "./logger";
import { logError } from "./hooks/log-error";
import { services } from "./services/index";
import { channels } from "./channels";
import { randomUUID } from "crypto";
import { Env, getEnv } from "./helpers/get-env";
const app: Application = express(feathers());
@@ -35,14 +35,20 @@ app.use(
);
app.use(cookieParser());
const sessionStore =
getEnv() === Env.prod
? new RedisStore({
prefix: "walias:",
client: createClient({
url: config.get("redis.url"),
}),
})
: undefined;
app.use(
session({
store: new RedisStore({
prefix: "walias:",
client: createClient({
url: config.get("redis.url"),
}),
}),
store: sessionStore,
secret: randomUUID(),
resave: false,
saveUninitialized: false,