Compare commits

...

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
842844c831 Simplify nil check based on code review feedback
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-17 12:59:57 +00:00
copilot-swe-agent[bot]
ba357635b1 Fix groups not being assigned when registering through OAuth providers
- Added userEnforcer.UpdateGroupsForUser call in UpdateUserForAllFields
- This ensures groups are synced to casbin when OAuth properties are updated
- Fixes issue where invitation code groups were lost during OAuth signup

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-17 12:58:41 +00:00
copilot-swe-agent[bot]
e4a3df3baf Initial plan 2026-02-17 12:51:07 +00:00

View File

@@ -954,6 +954,13 @@ func UpdateUserForAllFields(id string, user *User) (bool, error) {
user.UpdatedTime = util.GetCurrentTime()
if len(user.Groups) > 0 {
_, err = userEnforcer.UpdateGroupsForUser(user.GetId(), user.Groups)
if err != nil {
return false, err
}
}
affected, err := ormer.Engine.ID(core.PK{owner, name}).AllCols().Update(user)
if err != nil {
return false, err