mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-04-03 03:27:13 +08:00
Fix game url stuff in google.go
This commit is contained in:
parent
855760ed01
commit
611a0e3dec
@ -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…
x
Reference in New Issue
Block a user