[openstreetmap/openstreetmap-website] Blocked user cannot log on to community.osm.org (Issue #3522)
mmd
notifications at github.com
Tue Apr 5 17:46:28 UTC 2022
Following up on https://community.openstreetmap.org/t/my-user-is-blocked/1006/11
Once a user has been blocked, they can no longer log on to community.osm.org, because fetching user details using /api/0.6/user/details is being rejected by HTTP 403 "Your access to the API has been blocked. Please log-in to the web interface to find out more.”
app/controllers/api_controller.rb seems to be the relevant bit in the website code:
```ruby
# have we identified the user?
if current_user
# check if the user has been banned
user_block = current_user.blocks.active.take
unless user_block.nil?
set_locale
if user_block.zero_hour?
report_error t("application.setup_user_auth.blocked_zero_hour"), :forbidden
else
report_error t("application.setup_user_auth.blocked"), :forbidden
end
end
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3522
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3522 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220405/bcec4d24/attachment.htm>
More information about the rails-dev
mailing list