Skip to content

Commit

Permalink
Use username as subject (treeverse#7637)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-har authored and Victor Chen committed May 27, 2024
1 parent a8056a4 commit 7e802f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func (c *Controller) StsLogin(w http.ResponseWriter, r *http.Request, body apige
return
}
// validate a user exists with the external user id
_, err = c.Auth.GetUserByExternalID(ctx, externalUserID)
user, err := c.Auth.GetUserByExternalID(ctx, externalUserID)
if c.handleAPIError(ctx, w, r, err) {
return
}
Expand All @@ -576,7 +576,7 @@ func (c *Controller) StsLogin(w http.ResponseWriter, r *http.Request, body apige
}
now := time.Now()
expiresAt := now.Add(time.Duration(expiresInSec) * time.Second)
token, err := GenerateJWTLogin(c.Auth.SecretStore().SharedSecret(), externalUserID, now, expiresAt)
token, err := GenerateJWTLogin(c.Auth.SecretStore().SharedSecret(), user.Username, now, expiresAt)
if c.handleAPIError(ctx, w, r, err) {
return
}
Expand Down

0 comments on commit 7e802f7

Please sign in to comment.