mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
23 lines
408 B
JavaScript
23 lines
408 B
JavaScript
import { model } from 'mongoose'
|
|
|
|
const User = model('User', {
|
|
username: {
|
|
type: String,
|
|
unique: true,
|
|
required: false, // should be required,
|
|
// but need to let social login users to pick one after login
|
|
},
|
|
email: {
|
|
type: String,
|
|
unique: true,
|
|
required: true,
|
|
},
|
|
hashedPassword: String,
|
|
google: {
|
|
id: String,
|
|
displayName: String,
|
|
},
|
|
})
|
|
|
|
export default User
|