Skip to content

Commit

Permalink
fix: my fix would have broken something else + updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zleyyij committed Jul 16, 2024
1 parent ee8be35 commit da7c2bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ mod tests {
s!("username2"),
s!("token2"),
s!("expiration_date2"),
s!("https://foo.bar"),
s!("https://foo.bar/2"),
)
.await
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers_prelude/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async fn get_oath_processor(
.expires_in()
.wrap_err("Discord OAuth2 response didn't include an expiration date")?;
// Update the user entry if one is already there, otherwise create a user
if let Some(existing_user) = all_users.iter().find(|u| u.token == *token) {
if let Some(existing_user) = all_users.iter().find(|u| u.username == discord_user_info.username) {
state
.db
.update_user(&User {
Expand Down

0 comments on commit da7c2bc

Please sign in to comment.