Skip to content

Commit

Permalink
auth: Fix client version not getting persisted
Browse files Browse the repository at this point in the history
Gorm won't save changes to associated objects unless you use a
gorm.Session with FullSaveAssociations: true.
  • Loading branch information
evan-goode committed Apr 29, 2024
1 parent 87a0749 commit 153fc66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func AuthAuthenticate(app *App) func(c echo.Context) error {
}
}

result = app.DB.Save(&user)
// Save changes to user.Clients
result = app.DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&user)
if result.Error != nil {
return result.Error
}
Expand Down

0 comments on commit 153fc66

Please sign in to comment.