What is the correct way to set the WWW-Authenticate header in response to rails?
I am currently doing this:
headers["WWW-Authenticate"] = %(Basic realm="My Realm") render :json => {:message =>I18n.t("errors.messages.authorization_error")}, :status => :unauthorized
I think there is an easier way to set this header using rails api. Without direct access to the header.
source share