diff --git a/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml b/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml index ce21bac9..8c4f9a84 100644 --- a/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml +++ b/openapi/components/responses/authentication/CurrentUserLoginResponse.yaml @@ -2,10 +2,12 @@ description: OK content: application/json: schema: - $ref: ../../schemas/CurrentUser.yaml + oneOf: + - $ref: ../../schemas/CurrentUser.yaml + - $ref: ../../schemas/TwoFactorRequired.yaml headers: Set-Cookie: schema: type: string - example: 'auth=authcookie_00000000-0000-0000-0000-000000000000; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly' + example: "auth=authcookie_00000000-0000-0000-0000-000000000000; Expires=Tue, 01 Jan 2030 00:00:00 GMT; Path=/; HttpOnly" description: Successful authentication returns an `auth` cookie. diff --git a/openapi/components/schemas/TwoFactorRequired.yaml b/openapi/components/schemas/TwoFactorRequired.yaml new file mode 100644 index 00000000..04b1364c --- /dev/null +++ b/openapi/components/schemas/TwoFactorRequired.yaml @@ -0,0 +1,13 @@ +title: TwoFactorRequired +type: object +properties: + requiresTwoFactorAuth: + type: array + items: + type: string + enum: + - totp + - otp + - emailOtp +required: + - requiresTwoFactorAuth