-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVerifySignupSetPasswordShortService.ts
41 lines (36 loc) · 1.4 KB
/
VerifySignupSetPasswordShortService.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { makeDefaultOptions } from '../options';
import { verifySignupSetPasswordWithShortToken } from '../methods/verify-signup-set-password';
import { AuthenticationManagementBase } from './AuthenticationManagementBase';
import type {
DataVerifySignupSetPasswordShort,
SanitizedUser,
VerifySignupSetPasswordShortServiceOptions
} from '../types';
import type { Application, Params } from '@feathersjs/feathers';
export class VerifySignupSetPasswordShortService
extends AuthenticationManagementBase<DataVerifySignupSetPasswordShort, SanitizedUser, VerifySignupSetPasswordShortServiceOptions> {
constructor (app: Application, options?: Partial<VerifySignupSetPasswordShortServiceOptions>) {
super(app);
const defaultOptions: VerifySignupSetPasswordShortServiceOptions = makeDefaultOptions([
'service',
'notifier',
'sanitizeUserForClient',
'passwordField',
'skipPasswordHash',
'identifyUserProps',
'passParams'
]);
this.options = Object.assign(defaultOptions, options);
}
async _create (data: DataVerifySignupSetPasswordShort, params?: Params): Promise<SanitizedUser> {
const passedParams = this.options.passParams && await this.options.passParams(params);
return await verifySignupSetPasswordWithShortToken(
this.optionsWithApp,
data.token,
data.user,
data.password,
data.notifierOptions,
passedParams
);
}
}