Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
580B

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