|
|
|
@ -33,13 +33,13 @@ var (
|
|
|
|
|
func HandleDiscordCallback(w http.ResponseWriter, r *http.Request) (string, error) {
|
|
|
|
|
code := r.URL.Query().Get("code")
|
|
|
|
|
if code == "" {
|
|
|
|
|
defer http.Redirect(w, r, GameURL, http.StatusSeeOther)
|
|
|
|
|
http.Redirect(w, r, GameURL, http.StatusSeeOther)
|
|
|
|
|
return "", errors.New("code is empty")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
discordId, err := RetrieveDiscordId(code)
|
|
|
|
|
if err != nil {
|
|
|
|
|
defer http.Redirect(w, r, GameURL, http.StatusSeeOther)
|
|
|
|
|
http.Redirect(w, r, GameURL, http.StatusSeeOther)
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|