add remove method for aliases
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -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");
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user