-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(auth): update FetchDevicesOutput output type to include name attribute #14186
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import { | |
assertTokenProviderConfig, | ||
} from '@aws-amplify/core/internals/utils'; | ||
|
||
import { FetchDevicesOutput } from '../types'; | ||
import { AWSAuthDevice, FetchDevicesOutput } from '../types'; | ||
import { DeviceType } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/types'; | ||
import { assertAuthTokens } from '../utils/types'; | ||
import { getRegionFromUserPoolId } from '../../../foundation/parsers'; | ||
|
@@ -77,7 +77,7 @@ const parseDevicesResponse = async ( | |
{}, | ||
); | ||
|
||
return { | ||
const result: AWSAuthDevice = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could be devices.map<AWSAuthDevice>() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nvm by this 👀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tried this as well but TS only enforces mandatory keys |
||
id, | ||
name: deviceName, | ||
attributes, | ||
|
@@ -91,6 +91,8 @@ const parseDevicesResponse = async ( | |
? new Date(DeviceLastAuthenticatedDate * 1000) | ||
: undefined, | ||
}; | ||
|
||
return result; | ||
}, | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,4 +332,5 @@ export interface AWSAuthUser { | |
*/ | ||
export interface AuthDevice { | ||
id: string; | ||
name?: string; | ||
} |
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.
we should probably update all API unit tests to
(reference)