aboutsummaryrefslogtreecommitdiffstats
path: root/models/login.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/login.go')
-rw-r--r--models/login.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/login.go b/models/login.go
index 1ec5309db4..5e26010647 100644
--- a/models/login.go
+++ b/models/login.go
@@ -36,7 +36,6 @@ const (
var (
ErrAuthenticationAlreadyExist = errors.New("Authentication already exist")
- ErrAuthenticationNotExist = errors.New("Authentication does not exist")
ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users")
)
@@ -191,13 +190,14 @@ func LoginSources() ([]*LoginSource, error) {
return auths, x.Find(&auths)
}
+// GetLoginSourceByID returns login source by given ID.
func GetLoginSourceByID(id int64) (*LoginSource, error) {
source := new(LoginSource)
has, err := x.Id(id).Get(source)
if err != nil {
return nil, err
} else if !has {
- return nil, ErrAuthenticationNotExist
+ return nil, ErrAuthenticationNotExist{id}
}
return source, nil
}