mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
feat: change to use commonjs output
This commit is contained in:
1 parent
2bdb804f24
commit
557af91d4b
24 files changed
+35
-18
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
|
||||
const socialLoginSchema = new Schema({
|
||||
provider: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
displayName: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
})
|
||||
|
||||
const User = model(
|
||||
'User',
|
||||
new Schema(
|
||||
{
|
||||
username: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
hashedPassword: String,
|
||||
socialLogins: {
|
||||
type: Map,
|
||||
of: socialLoginSchema,
|
||||
default: {},
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
export default User
|
||||
Reference in new issue
Block a user