mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
Fix error message of missing cert when login
This commit is contained in:
parent
d7110ff8bf
commit
e850e33f37
@ -281,6 +281,14 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
|
|||||||
return "", "", "", err
|
return "", "", "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cert == nil {
|
||||||
|
if application.Cert == "" {
|
||||||
|
return "", "", "", fmt.Errorf("The cert field of the application \"%s\" should not be empty", application.GetId())
|
||||||
|
} else {
|
||||||
|
return "", "", "", fmt.Errorf("The cert \"%s\" does not exist", application.Cert)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// RSA private key
|
// RSA private key
|
||||||
key, err := jwt.ParseRSAPrivateKeyFromPEM([]byte(cert.PrivateKey))
|
key, err := jwt.ParseRSAPrivateKeyFromPEM([]byte(cert.PrivateKey))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user