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