Gamma API

Verify an emailed code

POST
/api/auth/two-factor/verify-otp

Verify two factor OTP

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
code*string

The otp code to verify. Eg: "012345"

trustDevice?boolean

Response Body

Two-factor OTP verified successfully

application/json
  1. response
token*string

Session token for the authenticated session

user*

The authenticated user object

Example Request
curl -X POST 'http://localhost:3000/api/auth/two-factor/verify-otp' \  -H 'Content-Type: application/json' \  -d '{  "code": "string"}'
Example Response
{  "token": "string",  "user": {    "id": "string",    "email": "user@example.com",    "emailVerified": true,    "name": "string",    "image": "http://example.com",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}