diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/auth/auth.service.ts | 16 | ||||
-rw-r--r-- | services/index.ts | 2 |
2 files changed, 18 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); +}; + diff --git a/services/index.ts b/services/index.ts index d946e9d..f000837 100644 --- a/services/index.ts +++ b/services/index.ts @@ -2,8 +2,10 @@ import { Application } from '@feathersjs/express'; import Users from './users/users.service'; import Polls from './polls/polls.service'; import Profiles from './profiles/profiles.service'; +import Auth from './auth/auth.service'; export default (app: Application): void => { + app.configure(Auth); app.configure(Users); app.configure(Polls); app.configure(Profiles); |