1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.BBS.Authenticator do
6 use Sshd.PasswordAuthenticator
8 alias Pleroma.Web.Plugs.AuthenticationPlug
10 def authenticate(username, password) do
11 username = to_string(username)
12 password = to_string(password)
14 with %User{} = user <- User.get_by_nickname(username) do
15 AuthenticationPlug.checkpw(password, user.password_hash)