From 8d85b0f87590b0941dfb2d8815aa2c7b7462a89f Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 4 Dec 2022 19:14:41 +0530 Subject: saving and checking refreshToken in DB --- user/user.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'user/user.go') 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"` } -- cgit v1.2.3