Skip to content

Commit

Permalink
Merge pull request #3017 from cloudfoundry-incubator/token-refresh-up…
Browse files Browse the repository at this point in the history
…grade-fix

Fix bug where token IDs are not set properly when upgrading from a previous version
  • Loading branch information
nwmac authored Sep 18, 2018
2 parents 0d1a744 + b9ff52c commit a82510d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jetstream/datastore/20180824092600_LinkedTokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ func init() {
// Ensure any existing tokens have an ID

// For UAA tokens, use the user id
ensureUAATokenID := "UPDATE tokens SET token_guid=user_guid WHERE token_guid IS NULL AND token_type='uaa'"
ensureUAATokenID := "UPDATE tokens SET token_guid=user_guid WHERE token_guid='default-token' AND token_type='uaa'"
_, err = txn.Exec(ensureUAATokenID)
if err != nil {
return err
}

// For CNSI tokens, use the cnsi guid
ensureCNSITokenID := "UPDATE tokens SET token_guid=cnsi_guid WHERE token_guid IS NULL"
ensureCNSITokenID := "UPDATE tokens SET token_guid=cnsi_guid WHERE token_guid='default-token'"
_, err = txn.Exec(ensureCNSITokenID)
if err != nil {
return err
Expand Down

0 comments on commit a82510d

Please sign in to comment.