forked from yash17525/passport-otp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
29 lines (21 loc) · 810 Bytes
/
index.js
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
"use strict";
var loopback = require("loopback");
var DataModel = loopback.PersistedModel || loopback.DataModel;
function loadModel(jsonFile) {
var modelDefinition = require(jsonFile);
return DataModel.extend(modelDefinition.name, modelDefinition.properties, {
relations: modelDefinition.relations
});
}
// Load modules.
const Strategy = require("./strategy");
// Expose Strategy.
exports = module.exports = Strategy;
// Export Otp Model
var OtpModel = loadModel("./lib/models/Otp.json");
exports.Otp = module.exports.Otp = require("./lib/models/Otp")(OtpModel);
exports.Otp.autoAttach = "db";
//Export Twilio Model
var TwilioModel = loadModel("./lib/models/Twilio.json");
exports.Twilio = module.exports.Twilio = require("./lib/models/Twilio")(TwilioModel);
exports.Twilio.autoAttach = "db";