mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix: keystone username duplicate error should return 409
This commit is contained in:
@@ -85,7 +85,9 @@ func authenticateTokensV3(ctx context.Context, w http.ResponseWriter, r *http.Re
|
||||
token, err := AuthenticateV3(ctx, input)
|
||||
if err != nil {
|
||||
switch errors.Cause(err) {
|
||||
case sqlchemy.ErrDuplicateEntry, httperrors.ErrTooManyAttempts:
|
||||
case sqlchemy.ErrDuplicateEntry:
|
||||
httperrors.ConflictError(w, "duplicate username")
|
||||
case httperrors.ErrTooManyAttempts:
|
||||
httperrors.GeneralServerError(w, err)
|
||||
default:
|
||||
httperrors.UnauthorizedError(w, "unauthorized %s", err)
|
||||
|
||||
Reference in New Issue
Block a user