X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fplugs%2Fauthentication_plug.ex;h=d47c3fdae75e63deee1b7fda2e9693ac54e0f4d0;hb=c48c381e909240dcece9f961e4728fa712d089cc;hp=a3317f432d5de1041b67e76ba754bfa3dc4c9073;hpb=32aa83f3a2a6ab14e36a3452708ea3be94ad4c43;p=akkoma diff --git a/lib/pleroma/plugs/authentication_plug.ex b/lib/pleroma/plugs/authentication_plug.ex index a3317f432..d47c3fdae 100644 --- a/lib/pleroma/plugs/authentication_plug.ex +++ b/lib/pleroma/plugs/authentication_plug.ex @@ -1,4 +1,5 @@ defmodule Pleroma.Plugs.AuthenticationPlug do + alias Comeonin.Pbkdf2 import Plug.Conn def init(options) do @@ -25,12 +26,12 @@ defmodule Pleroma.Plugs.AuthenticationPlug do end defp verify(nil, _password, _user_id) do - Comeonin.Pbkdf2.dummy_checkpw + Pbkdf2.dummy_checkpw :error end defp verify(user, password, _user_id) do - if Comeonin.Pbkdf2.checkpw(password, user.password_hash) do + if Pbkdf2.checkpw(password, user.password_hash) do {:ok, user} else :error @@ -42,7 +43,7 @@ defmodule Pleroma.Plugs.AuthenticationPlug do {:ok, userinfo} <- Base.decode64(header), [username, password] <- String.split(userinfo, ":") do - { :ok, username, password } + {:ok, username, password} end end