Skip to content

Commit 9092927

Browse files
committed
databaseauth: Return ErrNotAuthorized instead of generic error.
1 parent 3590212 commit 9092927

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

users/databaseauth/module.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package databaseauth
22

33
import (
4-
"errors"
54
"net/http"
65

76
"github.com/octavore/naga/service"
@@ -74,7 +73,7 @@ func (m *Module) handleLogin(rw http.ResponseWriter, req *http.Request, par rout
7473
return err
7574
}
7675
if !valid {
77-
return errors.New("invalid user")
76+
return router.ErrNotAuthorized
7877
}
7978
err = m.Sessions.CreateSession(userID, rw)
8079
if err != nil {

0 commit comments

Comments
 (0)