Skip to content

Commit 1e0f70c

Browse files
remove old username before update
1 parent 73572c5 commit 1e0f70c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/handlers/http/oidc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ pub async fn reply_login(
219219
// If no roles were found, use the default role
220220
final_roles.clone_from(&default_role);
221221
}
222+
222223
let user = match (existing_user, final_roles) {
223224
(Some(user), roles) => update_user_if_changed(user, roles, user_info).await?,
224225
(None, roles) => put_user(&user_id, roles, user_info).await?,
@@ -425,7 +426,7 @@ pub async fn update_user_if_changed(
425426
entry.clone_from(&user);
426427
put_metadata(&metadata).await?;
427428
}
428-
429+
Users.delete_user(&old_username);
429430
Users.put_user(user.clone());
430431
Ok(user)
431432
}

0 commit comments

Comments
 (0)