mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-08 00:56:58 +03:00
authentication fixes
This commit is contained in:
parent
0981c2fe07
commit
dfeb0fbb43
6 changed files with 44 additions and 63 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"reflect"
|
||||
"text/template"
|
||||
|
||||
"github.com/GeertJohan/go.rice"
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/labstack/echo-contrib/session"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
@ -44,9 +44,9 @@ func (t *TemplateRegistry) Render(w io.Writer, name string, data interface{}, c
|
|||
}
|
||||
|
||||
// New function
|
||||
func New(tmplBox *rice.Box, extraData map[string]string) *echo.Echo {
|
||||
func New(tmplBox *rice.Box, extraData map[string]string, secret []byte) *echo.Echo {
|
||||
e := echo.New()
|
||||
e.Use(session.Middleware(sessions.NewCookieStore([]byte("secret"))))
|
||||
e.Use(session.Middleware(sessions.NewCookieStore(secret)))
|
||||
|
||||
// read html template file to string
|
||||
tmplBaseString, err := tmplBox.String("base.html")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue