mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add unique index to token properties
This commit is contained in:
parent
441c207953
commit
95292a2e55
1 changed files with 3 additions and 1 deletions
|
@ -43,11 +43,13 @@ ProjectSchema = new Schema
|
||||||
tokens :
|
tokens :
|
||||||
readOnly : {
|
readOnly : {
|
||||||
type: String,
|
type: String,
|
||||||
default: generateToken(14)
|
default: generateToken(14),
|
||||||
|
index: {unique: true}
|
||||||
}
|
}
|
||||||
readAndWrite : {
|
readAndWrite : {
|
||||||
type: String,
|
type: String,
|
||||||
default: Math.random().toString().slice(2, 10) + generateToken(12)
|
default: Math.random().toString().slice(2, 10) + generateToken(12)
|
||||||
|
index: {unique: true}
|
||||||
}
|
}
|
||||||
tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ]
|
tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ]
|
||||||
tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ]
|
tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ]
|
||||||
|
|
Loading…
Reference in a new issue