diff --git a/src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices/index.mdx b/src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices/index.mdx index 7c2451af61e..f0e6cf54310 100644 --- a/src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices/index.mdx +++ b/src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices/index.mdx @@ -270,7 +270,7 @@ func forgetDevice() async { print("Forget device failed with error \(error)") } catch { print("Unexpected error: \(error)") - } + } } ``` @@ -326,6 +326,8 @@ Future fetchAllDevices() async { ``` + + @@ -426,6 +428,25 @@ func fetchDevices() -> AnyCancellable { + + +## Fetch the current device + +You can fetch the current device by using the following: + +```dart +Future fetchCurrentUserDevice() async { + try { + final device = await Amplify.Auth.fetchCurrentDevice(); + safePrint('Device: $device'); + } on AuthException catch (e) { + safePrint('Get current device failed with error: $e'); + } +} +``` + + + You can now set up devices to be remembered, forgotten, and fetched. {/* user agents */}