Sign in via Twitter (WIP).
This commit is contained in:
parent
2c8deecdd2
commit
63ab61ed3f
9 changed files with 63 additions and 10 deletions
|
|
@ -15,11 +15,22 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|
|||
|
||||
import Pleroma.Web.ControllerHelper, only: [oauth_scopes: 2]
|
||||
|
||||
plug(Ueberauth)
|
||||
plug(:fetch_session)
|
||||
plug(:fetch_flash)
|
||||
|
||||
action_fallback(Pleroma.Web.OAuth.FallbackController)
|
||||
|
||||
def callback(%{assigns: %{ueberauth_failure: _failure}} = conn, _params) do
|
||||
conn
|
||||
|> put_flash(:error, "Failed to authenticate.")
|
||||
|> redirect(to: "/")
|
||||
end
|
||||
|
||||
def callback(%{assigns: %{ueberauth_auth: _auth}} = _conn, _params) do
|
||||
raise "Authenticated successfully. Sign up via OAuth is not yet implemented."
|
||||
end
|
||||
|
||||
def authorize(conn, params) do
|
||||
app = Repo.get_by(App, client_id: params["client_id"])
|
||||
available_scopes = (app && app.scopes) || []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue