revendore with auth 0.4.1, fix yandex auth provider bug
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ This library provides "social login" with Github, Google, Facebook and Yandex as
|
||||
|
||||
## Install
|
||||
|
||||
`go install github.com/go-pkgz/auth`
|
||||
`go get -u github.com/go-pkgz/auth`
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ func (s *Service) AddProvider(name string, cid string, csecret string) {
|
||||
case "facebook":
|
||||
s.providers = append(s.providers, provider.NewService(provider.NewFacebook(p)))
|
||||
case "yandex":
|
||||
s.providers = append(s.providers, provider.NewService(provider.NewFacebook(p)))
|
||||
s.providers = append(s.providers, provider.NewService(provider.NewYandex(p)))
|
||||
case "dev":
|
||||
s.providers = append(s.providers, provider.NewService(provider.NewDev(p)))
|
||||
default:
|
||||
|
||||
+17
@@ -73,6 +73,23 @@ func (u *User) IsAdmin() bool {
|
||||
return u.BoolAttr(adminAttr)
|
||||
}
|
||||
|
||||
// SliceAttr gets slice attribute
|
||||
func (u *User) SliceAttr(key string) []string {
|
||||
r, ok := u.Attributes[key].([]string)
|
||||
if !ok {
|
||||
return []string{}
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// SetSliceAttr sets boolean attribute
|
||||
func (u *User) SetSliceAttr(key string, val []string) {
|
||||
if u.Attributes == nil {
|
||||
u.Attributes = map[string]interface{}{}
|
||||
}
|
||||
u.Attributes[key] = val
|
||||
}
|
||||
|
||||
// HashID tries to hash val with hash.Hash and fallback to crc if needed
|
||||
func HashID(h hash.Hash, val string) string {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user