auth/login: Add csrf protection
This commit is contained in:
parent
3aa79b0d23
commit
1af9d0d83f
6 changed files with 42 additions and 8 deletions
|
|
@ -1,10 +1,11 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"net/http"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/sql"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/lazy"
|
||||
"github.com/gorilla/sessions"
|
||||
)
|
||||
|
||||
|
|
@ -14,8 +15,8 @@ type Auth struct {
|
|||
SQL *sql.SQL
|
||||
}
|
||||
|
||||
storeOnce sync.Once
|
||||
store sessions.Store
|
||||
store lazy.Lazy[sessions.Store]
|
||||
csrf lazy.Lazy[func(http.Handler) http.Handler]
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue