---
url: "https://vueda.dev/v3/reference/api/py/vueda.user.utils.md"
title: "user.utils"
---

# user.utils

## Overview

Utility functions for TOTP code generation and Twilio configuration checks.

## `get_current_totp_code` {#get_current_totp_code}

Return the formatted TOTP code for ``secret`` at the current time.

VUEDA sends this code to a user by email or SMS. Raises ``ValueError`` if no time counter is available.

### Signature {#get_current_totp_code-signature}

`get_current_totp_code(secret)`

#### Parameters {#get_current_totp_code-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="get_current_totp_code-param-secret">secret</span> | `str` | yes |  |  |

#### Returns {#get_current_totp_code-returns}

`str`

### Source {#get_current_totp_code-source}

`server/vueda/user/utils.py:14`

## `is_twilio_configured` {#is_twilio_configured}

Return True when the Twilio account SID, auth token, and caller ID settings are all set.

VUEDA offers and sends SMS messages only when this is True.

### Signature {#is_twilio_configured-signature}

`is_twilio_configured()`

### Source {#is_twilio_configured-source}

`server/vueda/user/utils.py:27`

## Source

`server/vueda/user/utils.py`
