Gamma API

Generate backup codes

POST
/api/auth/two-factor/generate-backup-codes

Generate new backup codes for two-factor authentication

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Secure- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Request Body

application/json
  1. body
password?string

The users password.

Response Body

Backup codes generated successfully

application/json
  1. response
status*true

Indicates if the backup codes were generated successfully

Value intrue
backupCodes*array<string>

Array of generated backup codes in plain text

Example Request
curl -X POST 'http://localhost:3000/api/auth/two-factor/generate-backup-codes' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "status": true,  "backupCodes": [    "string"  ]}