Skip to content

Commit

Permalink
fix device token
Browse files Browse the repository at this point in the history
  • Loading branch information
akrck02 committed Jul 17, 2024
1 parent f741d1f commit 8c68e56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions services/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func AddUserDevice(conn *mongo.Client, user *usersmodels.User, device *devicemod
device.User = user.Email

found, _ := FindDevice(coll, device)

device.Token = token
if found != nil {

log.Debug("Device already exists, updating token")
Expand All @@ -40,7 +40,6 @@ func AddUserDevice(conn *mongo.Client, user *usersmodels.User, device *devicemod
return device, nil
}

device.Token = token
log.Debug("Creating new device...")

_, insertErr := coll.InsertOne(database.GetDefaultContext(), device)
Expand Down
1 change: 0 additions & 1 deletion services/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func Register(conn *mongo.Client, user *usersmodels.User) *systemmodels.Error {
func Login(conn *mongo.Client, user *usersmodels.User, ip string, address string) (string, *systemmodels.Error) {

// Connect database

coll := conn.Database(database.CurrentDatabase).Collection(database.USER)
log.Info("Password: " + user.Password)
found := authorizationOk(conn, user.Email, user.Clone().Password, coll)
Expand Down

0 comments on commit 8c68e56

Please sign in to comment.