aboutsummaryrefslogtreecommitdiff
path: root/hooks/isAuthenticated.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-27 16:25:59 +0300
committereug-vs <eug-vs@keemail.me>2020-06-27 16:25:59 +0300
commit69b212128435cab2919f642fd8352b0b6cf93f83 (patch)
tree83ea84458cd85e991c8904357ae0ec62ce67a28f /hooks/isAuthenticated.ts
parent5b4b64905a1b59002bbd1edfdc77c9e422e33334 (diff)
downloadwhich-api-69b212128435cab2919f642fd8352b0b6cf93f83.tar.gz
feat: add isAuthenticated hook
Diffstat (limited to 'hooks/isAuthenticated.ts')
-rw-r--r--hooks/isAuthenticated.ts9
1 files changed, 9 insertions, 0 deletions
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<boolean> => {
+ console.log(context.params.authenticated);
+ return context.params.authenticated || false;
+};
+