Verify Email OTP

Verify email OTP code for 2FA during login. Requires the 2FA cookie set by /auth/sign-in/email.

Body
required
application/json
  • code
    Type: string
    required

    6-digit OTP code from email

  • trustDevice
    Type: boolean

    Trust this device for 30 days

Responses
  • application/json
  • 401

    Invalid OTP code or missing 2FA cookie

Request Example for post/auth/two-factor/verify-otp
curl https://api.gpcn.com/v1/auth/two-factor/verify-otp \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "code": "123456",
  "trustDevice": true
}'
{
  "user": {},
  "session": {}
}