mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-26 00:19:41 -05:00
Co-authored-by: Aditya Raj Singh <github@adityaraj.com> Co-authored-by: tbsagdic <86909795+tbsagdic@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
17 lines
394 B
Go
17 lines
394 B
Go
package web
|
|
|
|
import (
|
|
libError "errors"
|
|
"net/http"
|
|
|
|
"github.com/gtsteffaniak/filebrowser/backend/internal/errors"
|
|
)
|
|
|
|
// loginMethodHTTPStatus maps a login error to an HTTP status and client-safe message.
|
|
func loginMethodHTTPStatus(err error) (int, error) {
|
|
if libError.Is(err, errors.ErrWrongLoginMethod) {
|
|
return http.StatusUnauthorized, errors.ErrInvalidLoginMethod
|
|
}
|
|
return 0, err
|
|
}
|