Add default policy to response auth object

This commit is contained in:
vishalnayak 2016-03-10 19:55:38 -05:00
parent cba947b049
commit 378db2bc3c

View file

@ -672,7 +672,10 @@ func (c *Core) handleLoginRequest(req *logical.Request) (*logical.Response, *log
} }
if !strListSubset(te.Policies, []string{"root"}) { if !strListSubset(te.Policies, []string{"root"}) {
// Append 'default' policy to the token being created
te.Policies = append(te.Policies, "default") te.Policies = append(te.Policies, "default")
// Update the response with the policies associated with token
auth.Policies = append(auth.Policies, "default")
} }
if err := c.tokenStore.create(&te); err != nil { if err := c.tokenStore.create(&te); err != nil {