Merge remote-tracking branch 'parent/main' into kb_migration
This commit is contained in:
commit
ce3cf82f8f
175 changed files with 1951 additions and 826 deletions
21
app/controllers/api/v1/instances/languages_controller.rb
Normal file
21
app/controllers/api/v1/instances/languages_controller.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Instances::LanguagesController < Api::BaseController
|
||||
skip_before_action :require_authenticated_user!, unless: :limited_federation_mode?
|
||||
skip_around_action :set_locale
|
||||
|
||||
before_action :set_languages
|
||||
|
||||
vary_by ''
|
||||
|
||||
def show
|
||||
cache_even_if_authenticated!
|
||||
render json: @languages, each_serializer: REST::LanguageSerializer
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_languages
|
||||
@languages = LanguagesHelper::SUPPORTED_LOCALES.keys.map { |code| LanguagePresenter.new(code) }
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@ module WebAppControllerConcern
|
|||
end
|
||||
|
||||
def skip_csrf_meta_tags?
|
||||
current_user.nil?
|
||||
!(ENV['OMNIAUTH_ONLY'] == 'true' && Devise.omniauth_providers.length == 1) && current_user.nil?
|
||||
end
|
||||
|
||||
def set_app_body_class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue