diff --git a/handlers/google_auth.go b/handlers/google_auth.go index 9953c3c..9719a6c 100644 --- a/handlers/google_auth.go +++ b/handlers/google_auth.go @@ -298,6 +298,7 @@ func GoogleCallback(w http.ResponseWriter, r *http.Request) { if err != nil { helper.LogError(err, "Authorization check failed") helper.RespondWithError(w, http.StatusBadGateway, "Authorization check failed") + return } if !allowed { diff --git a/main.go b/main.go index 2f78b4d..d080ea4 100644 --- a/main.go +++ b/main.go @@ -241,7 +241,7 @@ func main() { helper.LogInfo("INFO: Authentication Microservice is running on http://localhost:8081") server := &http.Server{ - Addr: ":8080", + Addr: ":8081", Handler: handler, ReadTimeout: 15 * time.Second, WriteTimeout: 300 * time.Second, diff --git a/services/users.go b/services/users.go index df845dc..f5b1387 100644 --- a/services/users.go +++ b/services/users.go @@ -7,7 +7,7 @@ import ( func GetUserID(email string) (string, error) { log.Print(email) - query := `SELECT user_id, FROM users WHERE email_address = ? AND is_deleted = 0 LIMIT 1;` + query := `SELECT user_id FROM users WHERE email_address = ? AND is_deleted = 0 LIMIT 1;` var id string err := db.DB.QueryRow(query, email).Scan(&id) if err != nil {