diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-04 19:14:41 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-04 19:14:41 +0530 |
commit | 8d85b0f87590b0941dfb2d8815aa2c7b7462a89f (patch) | |
tree | 9399f22b2c1a2850f8762da69da344f0fc830fba /user | |
parent | a6737e7f233c43c8222faabca991d8c666837c05 (diff) |
saving and checking refreshToken in DB
Diffstat (limited to 'user')
-rw-r--r-- | user/user.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/user/user.go b/user/user.go index c6c3d53..4c41f24 100644 --- a/user/user.go +++ b/user/user.go @@ -30,12 +30,18 @@ var db *mongo.Collection = database.DB.Collection("Users") type Config struct { } +type Session struct { + Name string `bson:"Name" json:"Name"` + Token string `bson:"Token" json:"Token"` +} + type User struct { Id primitive.ObjectID `bson:"_id,omitempty" json:"Id"` UserName string `bson:"UserName" json:"UserName"` Email string `bson:"Email" json:"Email"` Password string `bson:"Password" json:"Password"` Config Config `bson:"Config" json:"Config"` + Sessions []Session `bson:"Sessions" json:"Sessions"` // some actions are only available when email is verified Verified bool `bson:"Verified" json:"Verified"` } |