RaptusBackend / models /AuthenticationModel.js
GitHub Actions
Initial commit
df72131
raw
history blame contribute delete
599 Bytes
const { mongoose } = require("mongoose");
const Schema = mongoose.Schema;
const loginAccountSchema = new Schema({
timestamp: {
type: Date,
default: Date.now()
},
UserID: {
type: Schema.Types.ObjectId,
ref: "User"
},
TeamId: {
type: Schema.Types.ObjectId,
ref: "Team"
},
SessionID: {
type: String
},
Status: {
type: Number
},
});
loginAccountSchema.virtual("url").get(function () {
return `/sessions/${this._id}`;
});
module.exports = mongoose.model("Authentication", loginAccountSchema);