Skip to content

Commit 3683ca2

Browse files
committed
csrf: Return errors.
1 parent 7dd14bc commit 3683ca2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

users/csrf/csrf.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@ func (m *Module) Decode(token string) (*csrfPayload, error) {
6262
func (m *Module) Verify(state, token string) (bool, error) {
6363
obj, err := jose.ParseEncrypted(token)
6464
if err != nil {
65-
m.Logger.Error(errors.Wrap(err))
66-
return false, nil
65+
return false, errors.Wrap(err)
6766
}
6867
b, err := obj.Decrypt(m.decryptionKey)
6968
csrfPayload := &csrfPayload{}
7069
if err = json.Unmarshal(b, csrfPayload); err != nil {
71-
m.Logger.Error(errors.Wrap(err))
72-
return false, nil
70+
return false, errors.Wrap(err)
7371
}
7472
if state != csrfPayload.State {
7573
return false, nil

0 commit comments

Comments
 (0)