File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,18 @@ func (api *API) scimPatchUser(rw http.ResponseWriter, r *http.Request) {
307
307
308
308
var status database.UserStatus
309
309
if sUser .Active {
310
- // The user will get transitioned to Active after logging in.
311
- status = database .UserStatusDormant
310
+ switch dbUser .Status {
311
+ case database .UserStatusActive :
312
+ // Keep the user active
313
+ status = database .UserStatusActive
314
+ case database .UserStatusDormant , database .UserStatusSuspended :
315
+ // Move (or keep) as dormant
316
+ status = database .UserStatusDormant
317
+ default :
318
+ // If the status is unknown, just move them to dormant.
319
+ // The user will get transitioned to Active after logging in.
320
+ status = database .UserStatusDormant
321
+ }
312
322
} else {
313
323
status = database .UserStatusSuspended
314
324
}
You can’t perform that action at this time.
0 commit comments