From 69b212128435cab2919f642fd8352b0b6cf93f83 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 27 Jun 2020 16:25:59 +0300 Subject: feat: add isAuthenticated hook --- hooks/isAuthenticated.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 hooks/isAuthenticated.ts (limited to 'hooks/isAuthenticated.ts') diff --git a/hooks/isAuthenticated.ts b/hooks/isAuthenticated.ts new file mode 100644 index 0000000..d0da8b6 --- /dev/null +++ b/hooks/isAuthenticated.ts @@ -0,0 +1,9 @@ +import { HookContext } from '@feathersjs/feathers'; +import { authenticate } from '@feathersjs/authentication'; + + +export default async (context: HookContext): Promise => { + console.log(context.params.authenticated); + return context.params.authenticated || false; +}; + -- cgit v1.2.3