diff options
Diffstat (limited to 'internal/auth/auth.go')
-rw-r--r-- | internal/auth/auth.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 2ae012d3..c1fef5fc 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -7,6 +7,8 @@ package auth import ( "fmt" + "github.com/pkg/errors" + "gogs.io/gogs/internal/errutil" ) @@ -40,8 +42,10 @@ type ErrBadCredentials struct { Args errutil.Args } +// IsErrBadCredentials returns true if the underlying error has the type +// ErrBadCredentials. func IsErrBadCredentials(err error) bool { - _, ok := err.(ErrBadCredentials) + _, ok := errors.Cause(err).(ErrBadCredentials) return ok } |