mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
BREAKING: change user social login schema
This commit is contained in:
1 parent
9e935b320a
commit
81581c4635
8 files changed
+59
-32
No files matched your search
+20
-7
@@ -1,5 +1,20 @@
|
||||
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(
|
||||
@@ -15,13 +30,11 @@ const User = model(
|
||||
required: true,
|
||||
},
|
||||
hashedPassword: String,
|
||||
google: {
|
||||
id: String,
|
||||
displayName: String,
|
||||
},
|
||||
github: {
|
||||
id: String,
|
||||
displayName: String,
|
||||
socialLogins: {
|
||||
type: Map,
|
||||
of: socialLoginSchema,
|
||||
default: {},
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user