普通の web サービスにありがちな感じで (Basic 認証でなく) HTML フォームでログインの認証をする場合、ログイン失敗したとき 401 Unauthorized を返せなくない?
というのも、 401 を返すなら WWW-Authenticate ヘッダが必須なんだけど、オレオレログインページに対応する challenge がないので……
rest - What WWW-Authenticate header should a http server return in a 401 response when using form-based authentication? - Stack Overflow
https://stackoverflow.com/questions/48408530/what-www-authenticate-header-should-a-http-server-return-in-a-401-response-when
つらいなぁ