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

View file

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