get:
  tags:
    - Profile & Info
  summary: Read secret key and qr for an Authenticator app
  operationId: MetTotpSecretGet
  description: >-
    Shows secret key and qr image in base64 format for an Authenticator app.
    Requires a token received from `/verify-2fa` endpoint.
  responses:
    '200':
      description: Successful Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/TotP.yaml
    '400':
      description: TotP is disabled
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '401':
      description: >-
        Unauthorized, wrong token type provided (e.g. the one received from
        /login endpoint)
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '404':
      description: time based one time secret key should be generated for this user
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '500':
      description: Invalid Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
post:
  tags:
    - Profile & Info
  summary: Creates a new secret key for an Authenticator app
  operationId: MetTotpSecretPost
  description: >-
    Creates a new secret key for an Authenticator app only for the first time!
    If another totP secret already exists for this user, an error will appear.
    Requires a valid JWT token received from the `/login` endpoint.
  responses:
    '200':
      description: Successful Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/TotP.yaml
    '400':
      description: TotP is disabled
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '401':
      description: Unauthorized or totP secret is already created
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '500':
      description: Invalid Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
delete:
  tags:
    - Profile & Info
  summary: >-
    Delete time based one time secret key of the current user. Requires a token
    received from `/verify-2fa` endpoint.
  operationId: MetTotpSecretDelete
  responses:
    '204':
      description: Successful operation.
      content: {}
    '400':
      description: TotP is disabled
      content:
        '*/*':
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '401':
      description: >-
        Unauthorized, wrong token type provided (e.g. the one received from
        /login endpoint)
      content:
        '*/*':
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '500':
      description: Invalid Operation
      content:
        '*/*':
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
