mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-28 08:58:38 +02:00
Fix bug in remember
This commit is contained in:
parent
6402c5da57
commit
470b7c0488
@ -49,6 +49,12 @@ func (u UserValues) GetValues() map[string]string {
|
||||
return u.Arbitrary
|
||||
}
|
||||
|
||||
// GetShouldRemember checks the form values for
|
||||
func (u UserValues) GetShouldRemember() bool {
|
||||
rm, ok := u.Values[authboss.CookieRemember]
|
||||
return ok && rm == "true"
|
||||
}
|
||||
|
||||
// ConfirmValues retrieves values on the confirm page.
|
||||
type ConfirmValues struct {
|
||||
HTTPFormValidator
|
||||
|
@ -11,7 +11,6 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/volatiletech/authboss"
|
||||
)
|
||||
|
||||
@ -44,7 +43,7 @@ func (r *Remember) RememberAfterAuth(w http.ResponseWriter, req *http.Request, h
|
||||
rmIntf := req.Context().Value(authboss.CTXKeyValues)
|
||||
if rmIntf == nil {
|
||||
return false, nil
|
||||
} else if rm, ok := rmIntf.(authboss.RememberValuer); ok && !rm.GetShouldRemember() {
|
||||
} else if rm, ok := rmIntf.(authboss.RememberValuer); !ok || !rm.GetShouldRemember() {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user