mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +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()
|
.common_store()
|
||||||
.get::<Str, SerdeBincode<Token>>(&reader, &token_key)
|
.get::<Str, SerdeBincode<Token>>(&reader, &token_key)
|
||||||
.map_err(ResponseError::internal)?
|
.map_err(ResponseError::internal)?
|
||||||
.ok_or(ResponseError::not_found(format!(
|
.ok_or(ResponseError::invalid_token(format!(
|
||||||
"token key: {}",
|
"token key does not exist: {}",
|
||||||
token_key
|
user_api_key
|
||||||
)))?;
|
)))?;
|
||||||
|
|
||||||
if token_config.revoked {
|
if token_config.revoked {
|
||||||
|
Loading…
Reference in New Issue
Block a user