mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +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
|
||||
}
|
||||
|
||||
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
|
||||
key, err := jwt.ParseRSAPrivateKeyFromPEM([]byte(cert.PrivateKey))
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user