diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-07-05 13:38:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 13:38:33 +0300 |
commit | 96398e544463651413ea80821c09ae7573f46cb1 (patch) | |
tree | df77b6f65247d87dbfde8000e918c83985624fc3 /hooks/tryAuthenticate.ts | |
parent | da76bb1bd8797c4e1dc657c489f597bf64918ceb (diff) | |
parent | 1c2f3c9e5b39826266d64f4227e53fff139ea948 (diff) | |
download | which-api-96398e544463651413ea80821c09ae7573f46cb1.tar.gz |
Merge pull request #17 from which-ecosystem/security
Prepare release-level backend security
Diffstat (limited to 'hooks/tryAuthenticate.ts')
-rw-r--r-- | hooks/tryAuthenticate.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hooks/tryAuthenticate.ts b/hooks/tryAuthenticate.ts index e179417..71306ba 100644 --- a/hooks/tryAuthenticate.ts +++ b/hooks/tryAuthenticate.ts @@ -3,6 +3,9 @@ import { authenticate } from '@feathersjs/authentication'; export default async (context: HookContext): Promise<HookContext> => { - return authenticate('jwt')(context).catch(() => context); + if (context.params?.headers?.authorization && context.path !== 'authentication') { + return authenticate('jwt')(context); + } + return context; }; |