mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
Return a HTTP 401 instead of 404 if token is not found
This commit is contained in:
parent
5f0f699f37
commit
878dd6912e
@ -38,9 +38,9 @@ impl ContextExt for Context<Data> {
|
||||
.common_store()
|
||||
.get::<Str, SerdeBincode<Token>>(&reader, &token_key)
|
||||
.map_err(ResponseError::internal)?
|
||||
.ok_or(ResponseError::not_found(format!(
|
||||
"token key: {}",
|
||||
token_key
|
||||
.ok_or(ResponseError::invalid_token(format!(
|
||||
"token key does not exist: {}",
|
||||
user_api_key
|
||||
)))?;
|
||||
|
||||
if token_config.revoked {
|
||||
|
Loading…
Reference in New Issue
Block a user