add remove method for aliases

This commit is contained in:
2023-07-30 00:50:42 +03:00
parent fb29813345
commit 70d95be227
23 changed files with 446 additions and 376 deletions

View File

@@ -1,17 +1,17 @@
import type { HookContext, NextFunction } from '../declarations'
import { logger } from '../logger'
import type { HookContext, NextFunction } from "../declarations";
import { logger } from "../logger";
export const logError = async (context: HookContext, next: NextFunction) => {
try {
await next()
await next();
} catch (error: any) {
logger.error(error.stack)
logger.error(error.stack);
// Log validation errors
if (error.data) {
logger.error('Data: %O', error.data)
logger.error("Data: %O", error.data);
}
throw error
throw error;
}
}
};

View File

@@ -1,9 +1,9 @@
import { NotAuthenticated } from '@feathersjs/errors'
import type { HookContext, NextFunction } from '../declarations'
import { NotAuthenticated } from "@feathersjs/errors";
import type { HookContext, NextFunction } from "../declarations";
// Check if user is stored in session
export const validateAuth = async (context: HookContext) => {
if (!context.params.session?.user) {
throw new NotAuthenticated('Not authenticated')
}
}
if (!context.params.session?.user) {
throw new NotAuthenticated("Not authenticated");
}
};