Fix game url stuff in google.go

pull/47/merge
Pancakes 3 months ago
parent 855760ed01
commit 611a0e3dec
No known key found for this signature in database
GPG Key ID: 5792877BFA27DC8F

@ -22,7 +22,6 @@ import (
"errors"
"net/http"
"net/url"
"os"
"github.com/golang-jwt/jwt/v5"
)
@ -35,15 +34,14 @@ var (
func HandleGoogleCallback(w http.ResponseWriter, r *http.Request) (string, error) {
code := r.URL.Query().Get("code")
gameUrl := os.Getenv("GAME_URL")
if code == "" {
defer http.Redirect(w, r, gameUrl, http.StatusSeeOther)
defer 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)
defer http.Redirect(w, r, GameURL, http.StatusSeeOther)
return "", err
}

Loading…
Cancel
Save