diff --git a/api/account/discord.go b/api/account/discord.go index eb5f776..5bb35e7 100644 --- a/api/account/discord.go +++ b/api/account/discord.go @@ -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 } diff --git a/api/account/google.go b/api/account/google.go index 9efaadc..e81ac88 100644 --- a/api/account/google.go +++ b/api/account/google.go @@ -35,13 +35,13 @@ var ( func HandleGoogleCallback(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") } googleId, err := RetrieveGoogleId(code) if err != nil { - defer http.Redirect(w, r, GameURL, http.StatusSeeOther) + http.Redirect(w, r, GameURL, http.StatusSeeOther) return "", err } diff --git a/api/endpoints.go b/api/endpoints.go index 47c3e7c..b9802fe 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -635,7 +635,7 @@ func handleProviderCallback(w http.ResponseWriter, r *http.Request) { }) } - defer http.Redirect(w, r, account.GameURL, http.StatusSeeOther) + http.Redirect(w, r, account.GameURL, http.StatusSeeOther) } func handleProviderLogout(w http.ResponseWriter, r *http.Request) {