Merge branch 'phoenix1.7' into 'develop'
Update to Phoenix 1.7 See merge request pleroma/pleroma!3900
This commit is contained in:
commit
5f19fbc5a9
18 changed files with 88 additions and 86 deletions
|
|
@ -26,7 +26,6 @@ defmodule Phoenix.Transports.WebSocket.Raw do
|
|||
conn
|
||||
|> fetch_query_params
|
||||
|> Transport.transport_log(opts[:transport_log])
|
||||
|> Transport.force_ssl(handler, endpoint, opts)
|
||||
|> Transport.check_origin(handler, endpoint, opts)
|
||||
|
||||
case conn do
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ defmodule Pleroma.Web do
|
|||
namespace: Pleroma.Web
|
||||
|
||||
# Import convenience functions from controllers
|
||||
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
|
||||
import Phoenix.Controller, only: [get_csrf_token: 0, view_module: 1]
|
||||
|
||||
import Pleroma.Web.ErrorHelpers
|
||||
import Pleroma.Web.Gettext
|
||||
|
|
|
|||
|
|
@ -9,7 +9,20 @@ defmodule Pleroma.Web.Endpoint do
|
|||
|
||||
alias Pleroma.Config
|
||||
|
||||
socket("/socket", Pleroma.Web.UserSocket)
|
||||
socket("/socket", Pleroma.Web.UserSocket,
|
||||
websocket: [
|
||||
path: "/websocket",
|
||||
serializer: [
|
||||
{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
|
||||
{Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
|
||||
],
|
||||
timeout: 60_000,
|
||||
transport_log: false,
|
||||
compress: false
|
||||
],
|
||||
longpoll: false
|
||||
)
|
||||
|
||||
socket("/live", Phoenix.LiveView.Socket)
|
||||
|
||||
plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint])
|
||||
|
|
|
|||
|
|
@ -1003,9 +1003,8 @@ defmodule Pleroma.Web.Router do
|
|||
options("/*path", RedirectController, :empty)
|
||||
end
|
||||
|
||||
# TODO: Change to Phoenix.Router.routes/1 for Phoenix 1.6.0+
|
||||
def get_api_routes do
|
||||
__MODULE__.__routes__()
|
||||
Phoenix.Router.routes(__MODULE__)
|
||||
|> Enum.reject(fn r -> r.plug == Pleroma.Web.Fallback.RedirectController end)
|
||||
|> Enum.map(fn r ->
|
||||
r.path
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Phoenix.Flash.get(@flash, :info) %></p>
|
||||
<% end %>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Phoenix.Flash.get(@flash, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<h2><%= Gettext.dpgettext("static_pages", "mfa recover page title", "Two-factor recovery") %></h2>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Phoenix.Flash.get(@flash, :info) %></p>
|
||||
<% end %>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Phoenix.Flash.get(@flash, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<h2><%= Gettext.dpgettext("static_pages", "mfa auth page title", "Two-factor authentication") %></h2>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Phoenix.Flash.get(@flash, :info) %></p>
|
||||
<% end %>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Phoenix.Flash.get(@flash, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<h2><%= Gettext.dpgettext("static_pages", "oauth register page title", "Registration Details") %></h2>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Phoenix.Flash.get(@flash, :info) %></p>
|
||||
<% end %>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<%= if Phoenix.Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Phoenix.Flash.get(@flash, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @conn, Routes.o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue