login endpoint returns 412 error code even if totp is disabled #1518

Closed
opened 2023-05-10 20:06:27 +00:00 by benimautner · 4 comments

Description

/login returns http status code 412 when username or password is wrong, which, according to the docs, is reserved for missing or invalid totp code.

Vikunja Frontend Version

v0.20.5

Vikunja API Version

v0.20.4

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

### Description /login returns http status code 412 when username or password is wrong, which, according to the docs, is reserved for missing or invalid totp code. ### Vikunja Frontend Version v0.20.5 ### Vikunja API Version v0.20.4 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
benimautner added the
kind/bug
label 2023-05-10 20:06:27 +00:00
Owner

You mean the status code? That can be a few different errors. You should check Vikunja's error code: https://vikunja.io/docs/errors/#user

For wrong username or password that's 1011, for an invalid totp code that's 1017.

You mean the status code? That can be a few different errors. You should check Vikunja's error code: https://vikunja.io/docs/errors/#user For wrong username or password that's 1011, for an invalid totp code that's 1017.
Author

I was talking about the http response code, which, according to the docs, should be 403 for wrong username or password instead of 412.
I am using the ErrorCode now. I was just confused because the api docs say something different.
https://try.vikunja.io/api/v1/docs#tag/user/paths/~1login/post

I was talking about the http response code, which, according to the docs, should be 403 for wrong username or password instead of 412. I am using the ErrorCode now. I was just confused because the api docs say something different. https://try.vikunja.io/api/v1/docs#tag/user/paths/~1login/post
Owner

Yeah the docs need an update.

Yeah the docs need an update.
Owner

Turns out swagger (or the lib we're using to generate swagger docs) only allows one response per http status code. That kind of prevents us from using multiple responses. I'll add a note to the docs.

Turns out swagger (or the lib we're using to generate swagger docs) only allows one response per http status code. That kind of prevents us from using multiple responses. I'll add a note to the docs.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1518
No description provided.