mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
34 lines
527 B
JavaScript
34 lines
527 B
JavaScript
import { model, Schema } from 'mongoose'
|
|
|
|
const User = model(
|
|
'User',
|
|
new Schema(
|
|
{
|
|
username: {
|
|
type: String,
|
|
unique: true,
|
|
required: true,
|
|
},
|
|
email: {
|
|
type: String,
|
|
unique: true,
|
|
required: true,
|
|
},
|
|
hashedPassword: String,
|
|
google: {
|
|
id: String,
|
|
displayName: String,
|
|
},
|
|
github: {
|
|
id: String,
|
|
displayName: String,
|
|
},
|
|
},
|
|
{
|
|
timestamps: true,
|
|
}
|
|
)
|
|
)
|
|
|
|
export default User
|