protect-endpoints: 404 instead of 403 for Scope

I know it’s not a documented use case, but it works and somehow returns 404 error instead of 403.

.service(
    web::scope("/admin")
        .service(index)
        .service(users)
        .guard(PermissionGuard::new(ROLE_ADMIN.to_string()))
);

Was checked on v3.0.0-beta.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Do you need this? #9 I mean is that the way to update readme?)

I would like to add this, thanks πŸ™‚

I found out how Guards work, and I found the way to send whatever you want. Guard just checks whether that service suits some conditions or not, and in that case just skips it. You can just make another service, with the same link, easy) Check it out. Is that enough?

Maybe there is a possibility to pass something to get 403 as macro does?

I will study this question a little later, and if possible, we will definitely do it at the library level. But at the moment, I do not know about such a possibility πŸ™

This is good point πŸ‘ I think need to describe this behavior in the documentation and readme (regarding the response code) πŸ€”

Would be great and very useful for newcomers.

This is good point πŸ‘ I think need to describe this behavior in the documentation and readme (regarding the response code) πŸ€”

I thought it’s the same, need to check