---
url: "https://vueda.dev/v3/reference/api/js/stores/storeUser/methods/activateTOTPDevice.md"
title: "activateTOTPDevice"
---

# activateTOTPDevice

## Overview

Activates the device that `setupTOTPDevice` started, then refetches the current user to pick up its devices.
Before rejecting with an `UnauthorizedError`, refetches the current user, so `authPendingFlow` names the flow
that the server now requires.

## Signature

`activateTOTPDevice(payload)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-payload">payload</span> | `object` | yes | The request body. |

#### payload Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-payload-code">code</span> | `string` |  |  | The code from the device. |

### Returns

`Promise`

## Source

`client/lib/stores/storeUser.js:549`
