mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Fix panic when renewing a github token from a previous version of Vault
This commit is contained in:
@@ -73,7 +73,15 @@ func (b *backend) pathLogin(
|
||||
func (b *backend) pathLoginRenew(
|
||||
req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
|
||||
|
||||
token := req.Auth.InternalData["token"].(string)
|
||||
if req.Auth == nil {
|
||||
return nil, fmt.Errorf("request auth was nil")
|
||||
}
|
||||
|
||||
tokenInt, ok := req.Auth.InternalData["token"]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("token created in previous version of Vault cannot be validated properly at renewal time")
|
||||
}
|
||||
token := tokenInt.(string)
|
||||
|
||||
var verifyResp *verifyCredentialsResp
|
||||
if verifyResponse, resp, err := b.verifyCredentials(req, token); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user