feathers-authentication-management
Version:
Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication
35 lines (34 loc) • 1.8 kB
JavaScript
;
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.VerifySignupLongService = void 0;
const options_1 = require("../options");
const verify_signup_1 = require("../methods/verify-signup");
const AuthenticationManagementBase_1 = require("./AuthenticationManagementBase");
class VerifySignupLongService extends AuthenticationManagementBase_1.AuthenticationManagementBase {
constructor(app, options) {
super(app);
const defaultOptions = (0, options_1.makeDefaultOptions)([
'service',
'notifier',
'sanitizeUserForClient',
'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_1.verifySignupWithLongToken)(this.optionsWithApp, data.token, data.notifierOptions, passedParams);
});
}
}
exports.VerifySignupLongService = VerifySignupLongService;