diff --git a/backend/frontend/frontend_included.go b/backend/frontend/frontend_included.go index 1848c4e4..064ab8d4 100644 --- a/backend/frontend/frontend_included.go +++ b/backend/frontend/frontend_included.go @@ -3,8 +3,10 @@ package frontend import ( + "bytes" "embed" "fmt" + "io" "io/fs" "net/http" "os" @@ -12,11 +14,55 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/pocket-id/pocket-id/backend/internal/middleware" ) //go:embed all:dist/* var frontendFS embed.FS +// This function, created by the init() method, writes to "w" the index.html page, populating the nonce +var writeIndexFn func(w io.Writer, nonce string) error + +func init() { + const scriptTag = "