Don't check the role period again as we've checked it earlier and it may be greater than the te Period

This commit is contained in:
Jeff Mitchell 2016-08-13 13:21:56 -04:00
parent bcb4ab5422
commit de60702d76
1 changed files with 1 additions and 3 deletions

View File

@ -1308,9 +1308,7 @@ func (ts *TokenStore) handleCreateCommon(
sysView := ts.System()
if role != nil && role.Period > 0 {
te.TTL = role.Period
} else if te.Period > 0 {
if te.Period > 0 {
te.TTL = te.Period
} else {
// Set the default lease if not provided, root tokens are exempt