UNPKG

feathers-authentication-management

Version:

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication

37 lines (36 loc) 1.98 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VerifySignupSetPasswordLongService = void 0; const options_1 = require("../options"); const verify_signup_set_password_1 = require("../methods/verify-signup-set-password"); const AuthenticationManagementBase_1 = require("./AuthenticationManagementBase"); class VerifySignupSetPasswordLongService extends AuthenticationManagementBase_1.AuthenticationManagementBase { constructor(app, options) { super(app); const defaultOptions = (0, options_1.makeDefaultOptions)([ 'service', 'notifier', 'sanitizeUserForClient', 'passwordField', 'skipPasswordHash', 'passParams' ]); this.options = Object.assign(defaultOptions, options); } _create(data, params) { return __awaiter(this, void 0, void 0, function* () { const passedParams = this.options.passParams && (yield this.options.passParams(params)); return yield (0, verify_signup_set_password_1.verifySignupSetPasswordWithLongToken)(this.optionsWithApp, data.token, data.password, data.notifierOptions, passedParams); }); } } exports.VerifySignupSetPasswordLongService = VerifySignupSetPasswordLongService;