revendore with auth 0.4.1, fix yandex auth provider bug
This commit is contained in:
Generated
+3
-3
@@ -112,7 +112,7 @@
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:d31c72099b9e195785933d11441bc92cce9b2c421f8fca712a7eaf36a8e55a47"
|
||||
digest = "1:38940db39a8ee330d3e7f68ab4c298575462f5986ae2bb0cafa86f095e9d32ad"
|
||||
name = "github.com/go-pkgz/auth"
|
||||
packages = [
|
||||
".",
|
||||
@@ -123,8 +123,8 @@
|
||||
"token",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "92256b685196d26a346dfbedea12898fe589b0eb"
|
||||
version = "v0.4.0"
|
||||
revision = "7597c083287c33ba5362687a7815a032fd92c418"
|
||||
version = "v0.4.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:7b1f422f560b103f435f8501f854f238f1ce00d0f8146e76eacdfa71f2c8d8c0"
|
||||
|
||||
+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