users: allow anonymous users to use /profile.json.
Allow logged out users to call https://danbooru.donmai.us/profile.json. This allows getting information on default settings and limits for anonymous users. May be a breaking API change if users were using the HTTP response code from /profile.json to check if they were successfully logged in.
This commit is contained in:
@@ -57,7 +57,7 @@ class UsersController < ApplicationController
|
||||
elsif request.format.html?
|
||||
redirect_to login_path(url: profile_path)
|
||||
else
|
||||
raise ActiveRecord::RecordNotFound
|
||||
respond_with(@user, methods: @user.full_attributes, template: "users/show")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user