mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 14:17:21 +01:00
Update pam to v2.0.0
This commit is contained in:
parent
adb2a8bdfb
commit
832c91beba
3 changed files with 10 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/msteinert/pam"
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
|
|
@ -48,6 +48,12 @@ func pamAuth(next http.Handler, w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, "Temporary authentication error, try again later", http.StatusServiceUnavailable)
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
err := t.End()
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("failed to end PAM transaction")
|
||||
}
|
||||
}()
|
||||
|
||||
if err := t.Authenticate(0); err != nil {
|
||||
log.Debug().Str("user", user).Err(err).Msg("auth error")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue