refresh-tokens
Version:
refresh tokens library for nodejs server with mongodb
18 lines (17 loc) • 648 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable no-unused-vars */
/* eslint-disable indent */
const mongoose_1 = __importDefault(require("mongoose"));
const { Schema } = mongoose_1.default;
const schema = new Schema({
userId: Schema.Types.ObjectId,
token: { type: String, require: true, unique: true },
payload: { type: Object },
pushNotificationToken: String
});
const model = mongoose_1.default.model('token', schema);
exports.default = model;
;