mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-02-28 19:41:29 +08:00
Don't defer redirects
This commit is contained in:
parent
611a0e3dec
commit
ed8122cd3b
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user