Commit 8df95130 authored by Mayel's avatar Mayel

lint

parent a2a8dce0
Pipeline #28836580 failed with stages
in 5 minutes and 23 seconds
......@@ -8,7 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.OAuth.{Authorization, Token, App}
alias Comeonin.Pbkdf2
alias Pleroma.Web.TwitterAPI.{TwitterAPI}
alias Pleroma.Web.TwitterAPI.TwitterAPI
import Ecto.Query
require Logger
......@@ -1129,25 +1129,24 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
json(conn, [])
end
end
end
def register(conn, _) do
conn
|> render(MastodonView, "register.html", %{error: false})
end
def register_post(conn, params) do
with {:ok, user} <- TwitterAPI.register_user(params),
{:ok, app} <- get_or_make_app(),
{:ok, auth} <- Authorization.create_authorization(app, user),
{:ok, token} <- Token.exchange_token(app, auth) do
def register(conn, _) do
conn
|> put_session(:oauth_token, token.token)
|> redirect(to: "/web/getting-started")
else
_e ->
|> render(MastodonView, "register.html", %{error: false})
end
def register_post(conn, params) do
with {:ok, user} <- TwitterAPI.register_user(params),
{:ok, app} <- get_or_make_app(),
{:ok, auth} <- Authorization.create_authorization(app, user),
{:ok, token} <- Token.exchange_token(app, auth) do
conn
|> render(MastodonView, "register.html", %{error: "Wrong details"})
|> put_session(:oauth_token, token.token)
|> redirect(to: "/web/getting-started")
else
_e ->
conn
|> render(MastodonView, "register.html", %{error: "Wrong details"})
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment