mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 11:31:55 +02:00
Add unique index to token properties
This commit is contained in:
@@ -43,11 +43,13 @@ ProjectSchema = new Schema
|
||||
tokens :
|
||||
readOnly : {
|
||||
type: String,
|
||||
default: generateToken(14)
|
||||
default: generateToken(14),
|
||||
index: {unique: true}
|
||||
}
|
||||
readAndWrite : {
|
||||
type: String,
|
||||
default: Math.random().toString().slice(2, 10) + generateToken(12)
|
||||
index: {unique: true}
|
||||
}
|
||||
tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ]
|
||||
tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ]
|
||||
|
||||
Reference in New Issue
Block a user