mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-04-01 02:32:55 +08:00
chore: Add logging for Discord ID addition in admin Discord link endpoint
This commit is contained in:
parent
715fe93440
commit
fd57ad36fb
@ -23,6 +23,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -684,7 +685,6 @@ func handleAdminDiscordLink(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
hasRole, err := account.IsUserDiscordAdmin(userDiscordId, account.DiscordGuildID)
|
||||
|
||||
if !hasRole || err != nil {
|
||||
httpError(w, r, fmt.Errorf("user does not have the required role"), http.StatusForbidden)
|
||||
return
|
||||
@ -695,6 +695,6 @@ func handleAdminDiscordLink(w http.ResponseWriter, r *http.Request) {
|
||||
httpError(w, r, err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
fmt.Printf("%s added discord id %s to username %s", userDiscordId, r.Form.Get("discordId"), r.Form.Get("username"))
|
||||
log.Printf("%s added discord id %s to username %s", userDiscordId, r.Form.Get("discordId"), r.Form.Get("username"))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user