1 | import { HookContext, NextFunction } from '@feathersjs/feathers'
|
2 | import { AuthenticationBase, ConnectionEvent } from '../core'
|
3 |
|
4 | export default (event: ConnectionEvent) => async (context: HookContext, next: NextFunction) => {
|
5 | await next()
|
6 |
|
7 | const {
|
8 | result,
|
9 | params: { connection }
|
10 | } = context
|
11 |
|
12 | if (connection) {
|
13 | const service = context.service as unknown as AuthenticationBase
|
14 |
|
15 | await service.handleConnection(event, connection, result)
|
16 | }
|
17 | }
|