Connect works

This commit is contained in:
Daniel 2024-08-04 01:53:19 -04:00
parent 9394046f31
commit 43ec360d08
2 changed files with 3 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"net/http" "net/http"
"strings"
"time" "time"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
@ -115,7 +116,7 @@ func (a *authenticator) routeAuth(w http.ResponseWriter, r *http.Request) {
Name: "jwt", Name: "jwt",
Value: tok, Value: tok,
HttpOnly: true, HttpOnly: true,
Secure: true, Secure: !strings.HasPrefix(r.Host, "localhost:"),
Domain: a.domain, Domain: a.domain,
}) })

View file

@ -17,7 +17,7 @@ func (s *Server) setupRoutes() {
r.Group(func(r chi.Router) { r.Group(func(r chi.Router) {
// authenticated routes // authenticated routes
r.Use(s.auth.AuthMiddleware(), s.auth.VerifyMiddleware()) r.Use(s.auth.VerifyMiddleware(), s.auth.AuthMiddleware())
s.nex.InstallPrivateRoutes(r) s.nex.InstallPrivateRoutes(r)
}) })