fix(backend): validate PAT name (#2906)
Uses the macros provided by validator to validate the name. The name already had a macro, but .validate was not called. Resolves #1549
This commit is contained in:
parent
d90cc09620
commit
53d45dafc2
@ -165,6 +165,10 @@ pub async fn edit_pat(
|
||||
redis: Data<RedisPool>,
|
||||
session_queue: Data<AuthQueue>,
|
||||
) -> Result<HttpResponse, ApiError> {
|
||||
info.0.validate().map_err(|err| {
|
||||
ApiError::InvalidInput(validation_errors_to_string(err, None))
|
||||
})?;
|
||||
|
||||
let user = get_user_from_headers(
|
||||
&req,
|
||||
&**pool,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user