2fa API auth

Hello,

I am struggling to use the api rest with a 2fa enabled account.

According to this documentation:

https://docs.joinpeertube.org/api-rest-reference.html#tag/Session/operation/getOAuthClient

  1. get clientid and clientsecret
  2. post to user/token

    it asks for 2fa.

which according to this:
https://docs.joinpeertube.org/api-rest-reference.html#tag/Users/operation/requestTwoFactor

this is required:

but the api complains it needs the token
which is obtained by asking token, so unless I am missing something (which im sure i am, as usual), there is a loop?

This endpoint is to request 2FA activation. To send OTP code you need to add a x-peertube-otp header in the user/token endpoint. I improved the doc in Add OTP header doc · Chocobozzz/PeerTube@19b8cfa · GitHub

holy ****!
i was doing something right, achievement unlocked!

and your solution worked,
thank you very much!