From bc3c30430e564a510c80694ef30091942520d1e8 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 26 Aug 2018 22:46:25 +0000 Subject: [PATCH] fix formatting --- lib/pleroma/web/router.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 913152c5a..68e159f6a 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -13,9 +13,12 @@ defmodule Pleroma.Web.Router do :ok, cond do # First, try logging in as if it was a name - user = Repo.get_by(User, %{nickname: username_or_email}) -> user + user = Repo.get_by(User, %{nickname: username_or_email}) -> + user + # If we get nil, we try using it as an email - user = Repo.get_by(User, %{email: username_or_email}) -> user + user = Repo.get_by(User, %{email: username_or_email}) -> + user end } end -- 2.45.2