phantomauth
Version:
An authentication library with built-in security features, designed for fast and boilerplate-free backend development. Ideal for quickly building MVPs with a reasonable level of security. Not intended for high-risk or enterprise level use.
29 lines (27 loc) • 499 B
JavaScript
import mongoose from "mongoose";
const userSchema = new mongoose.Schema({
email: {
type: String,
required: true,
unique: true,
trim: true,
lowercase: true
},
password: {
type: String,
required: true,
},
token: {
type: String,
default: null
},
twoFAsecret: {
type: String,
default: null
},
twoFAEnabled: {
type: Boolean,
default: false
}
});
export const User = mongoose.model('User', userSchema);