mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
feat: support shared cert in GetCert() API
This commit is contained in:
parent
cc82d292f0
commit
3297db688b
@ -146,7 +146,12 @@ func getCertByName(name string) (*Cert, error) {
|
||||
|
||||
func GetCert(id string) (*Cert, error) {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
return getCert(owner, name)
|
||||
cert, err := getCert(owner, name)
|
||||
if cert == nil && owner != "admin" {
|
||||
return getCert("admin", name)
|
||||
} else {
|
||||
return cert, err
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateCert(id string, cert *Cert) (bool, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user