-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate names in device flow status API response #3533
Conversation
@@ -20,12 +20,18 @@ func FindDeviceFlowAuthRequest(ctx RequestContext, deviceCode string) (*models.D | |||
return nil, err | |||
} | |||
|
|||
// TODO: do this in the data function | |||
// TODO: do these lookups in the data function when data.GetDeviceFlowAuthRequest | |||
// is converted to SQL | |||
if dfar.AccessKeyID > 0 { | |||
dfar.AccessKey, err = data.GetAccessKey(ctx.DBTxn, data.GetAccessKeysOptions{ByID: dfar.AccessKeyID}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this change but it seems a bit odd that the DeviceFlowAuthRequest
has a separate AccessKeyID
and AccessKey
8dc124e
to
93c71f3
Compare
if dfar.AccessKey != nil { | ||
if dfar.AccessKeyID != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug. AccessKey
is always nil because we don't populate it in the query used above.
ad46d2f
to
a34b12f
Compare
Populate user name and organization name in the login response
The accessKey field is always null, because we don't populate it in this call.
a34b12f
to
82caed0
Compare
Summary
This PR adds the user name and organization name to the device flow login response, so that all the fields in the response are correctly populated.
Previously the
GetAccessKey
operation did not populate theIssusedForName
. This PR fixes the function to populate that field.Also adds a lookup of the organization from the
AccessKey.OrganizationID
, so that we can include the name in the response.