Skip to content

Commit

Permalink
update discord name and picture when a user logs in
Browse files Browse the repository at this point in the history
  • Loading branch information
walkingeyerobot committed Aug 17, 2020
1 parent 3810d29 commit bc950e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ func oauthDiscordCallback(w http.ResponseWriter, r *http.Request, userID int64,
}
statement.Exec(p.ID, p.Name, p.Picture)

query := `update users set discord_name = ?, picture = ? where discord_id = ?`
_, err = tx.Exec(query, p.Name, p.Picture, p.ID)
if err != nil {
return err
}

row := tx.QueryRow(`SELECT id FROM users WHERE discord_id = ?`, p.ID)
var rowid string
err = row.Scan(&rowid)
Expand Down

0 comments on commit bc950e3

Please sign in to comment.