mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
15 lines
344 B
TypeScript
15 lines
344 B
TypeScript
import type { CustomMiddlewareOptions, RouterMiddleware } from '@/types/router';
|
|
import { VIEWS } from '@/constants';
|
|
|
|
export const customMiddleware: RouterMiddleware<CustomMiddlewareOptions> = async (
|
|
to,
|
|
from,
|
|
next,
|
|
isValid,
|
|
) => {
|
|
const valid = isValid({ to, from, next });
|
|
if (!valid) {
|
|
return next({ name: VIEWS.HOMEPAGE });
|
|
}
|
|
};
|