aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-07-05 14:22:02 +0300
committereug-vs <eug-vs@keemail.me>2020-07-05 14:22:02 +0300
commit6b04525bf529baca8d2fa2d591f3162bd4d88d4f (patch)
tree610663b4fc28b8b9a667b7363efb25271f1d7e11
parent4eaced8b6c21f5171823166ad2e2e393d7c78353 (diff)
downloadwhich-api-6b04525bf529baca8d2fa2d591f3162bd4d88d4f.tar.gz
hotfix: registration issue
-rw-r--r--hooks/tryAuthenticate.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/hooks/tryAuthenticate.ts b/hooks/tryAuthenticate.ts
index 71306ba..aa97648 100644
--- a/hooks/tryAuthenticate.ts
+++ b/hooks/tryAuthenticate.ts
@@ -3,7 +3,8 @@ import { authenticate } from '@feathersjs/authentication';
export default async (context: HookContext): Promise<HookContext> => {
- if (context.params?.headers?.authorization && context.path !== 'authentication') {
+ const authorization = context.params?.headers?.authorization;
+ if (authorization && authorization !== 'null' && context.path !== 'authentication') {
return authenticate('jwt')(context);
}
return context;