Fix game url stuff in google.go

pull/47/merge
Pancakes 4 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" "errors"
"net/http" "net/http"
"net/url" "net/url"
"os"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
) )
@ -35,15 +34,14 @@ var (
func HandleGoogleCallback(w http.ResponseWriter, r *http.Request) (string, error) { func HandleGoogleCallback(w http.ResponseWriter, r *http.Request) (string, error) {
code := r.URL.Query().Get("code") code := r.URL.Query().Get("code")
gameUrl := os.Getenv("GAME_URL")
if code == "" { if code == "" {
defer http.Redirect(w, r, gameUrl, http.StatusSeeOther) defer http.Redirect(w, r, GameURL, http.StatusSeeOther)
return "", errors.New("code is empty") return "", errors.New("code is empty")
} }
googleId, err := RetrieveGoogleId(code) googleId, err := RetrieveGoogleId(code)
if err != nil { if err != nil {
defer http.Redirect(w, r, gameUrl, http.StatusSeeOther) defer http.Redirect(w, r, GameURL, http.StatusSeeOther)
return "", err return "", err
} }

Loading…
Cancel
Save