Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85197690
frontend_settings_controller.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
frontend_settings_controller.ex
View Options
defmodule
Pleroma.Web.PleromaAPI.FrontendSettingsController
do
use
Pleroma.Web
,
:controller
alias
Pleroma.Web.Plugs.OAuthScopesPlug
plug
(
OAuthScopesPlug
,
%{
fallback
:
:proceed_unauthenticated
,
scopes
:
[]}
when
action
in
[
:available_frontends
,
:update_preferred_frontend
]
)
plug
(
Pleroma.Web.ApiSpec.CastAndValidate
)
defdelegate
open_api_operation
(
action
),
to
:
Pleroma.Web.ApiSpec.PleromaFrontendSettingsOperation
action_fallback
(
Pleroma.Web.MastodonAPI.FallbackController
)
@doc
"GET /api/v1/pleroma/preferred_frontend/available"
def
available_frontends
(
conn
,
_params
)
do
available
=
Pleroma.Config
.
get
([
:frontends
,
:pickable
])
conn
|>
json
(
available
)
end
@doc
"PUT /api/v1/pleroma/preferred_frontend"
def
update_preferred_frontend
(
%{
body_params
:
%{
frontend_name
:
preferred_frontend
}}
=
conn
,
_params
)
do
conn
|>
put_resp_cookie
(
"preferred_frontend"
,
preferred_frontend
)
|>
json
(%{
frontend_name
:
preferred_frontend
})
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Mon, Jun 29, 9:31 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1630734
Default Alt Text
frontend_settings_controller.ex (1 KB)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment