diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-14 17:05:34 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-14 17:05:34 +0300 |
commit | 5b587cff62b584fb5896f910f03f28f80cc28c54 (patch) | |
tree | 5dc993466a6bcc0572f889780f2a9cfc8fd5be08 /services/auth/auth.service.ts | |
parent | 7e3a7da42e756b42940b0a89234cc8ccf41d4bf8 (diff) | |
download | which-api-5b587cff62b584fb5896f910f03f28f80cc28c54.tar.gz |
feat: create auth service
Diffstat (limited to 'services/auth/auth.service.ts')
-rw-r--r-- | services/auth/auth.service.ts | 16 |
1 files changed, 16 insertions, 0 deletions
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); +}; + |