mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
fix: fix csrf token handling after login
This commit is contained in:
@@ -68,14 +68,14 @@ func (m *Middleware) RefreshToken(next http.Handler) http.Handler {
|
||||
|
||||
// mask the token
|
||||
maskedToken := maskToken(token, key)
|
||||
|
||||
// store the encoded token in the session
|
||||
encodedToken := encodeToken(maskedToken)
|
||||
m.o.sessionWriter(r, encodedToken)
|
||||
|
||||
// pass the token down the chain via the context
|
||||
r = r.WithContext(setToken(r.Context(), encodedToken))
|
||||
|
||||
// store the token in the session
|
||||
m.o.sessionWriter(r, encodedToken)
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user