1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Helpers.AuthHelper do
6 alias Pleroma.Web.Plugs.OAuthScopesPlug
11 Skips OAuth permissions (scopes) checks, assigns nil `:token`.
12 Intended to be used with explicit authentication and only when OAuth token cannot be determined.
14 def skip_oauth(conn) do
16 |> assign(:token, nil)
17 |> OAuthScopesPlug.skip_plug()
20 def drop_auth_info(conn) do
23 |> assign(:token, nil)