From 5b587cff62b584fb5896f910f03f28f80cc28c54 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Jun 2020 17:05:34 +0300 Subject: feat: create auth service --- services/auth/auth.service.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 services/auth/auth.service.ts (limited to 'services/auth/auth.service.ts') diff --git a/services/auth/auth.service.ts b/services/auth/auth.service.ts new file mode 100644 index 0000000..42846b0 --- /dev/null +++ b/services/auth/auth.service.ts @@ -0,0 +1,16 @@ +import { + AuthenticationService, + JWTStrategy +} from '@feathersjs/authentication'; +import { LocalStrategy } from '@feathersjs/authentication-local'; +import { Application } from '@feathersjs/express'; + +export default (app: Application): void => { + const authentication = new AuthenticationService(app); + + authentication.register('local', new LocalStrategy()); + authentication.register('jwt', new JWTStrategy()); + + app.use('/authentication', authentication); +}; + -- cgit v1.2.3