MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / GetPasswordByUsername

Method GetPasswordByUsername

internal/store/postgres/users.go:682–691  ·  view source on GitHub ↗
(username string)

Source from the content-addressed store, hash-verified

680}
681
682func (s *UserStore) GetPasswordByUsername(username string) (string, string, string, error) {
683 var userID, hash, subToken string
684 err := s.db.QueryRow(context.Background(),
685 `SELECT id, password, sub_token FROM users WHERE username = $1`, username,
686 ).Scan(&userID, &hash, &subToken)
687 if errors.Is(err, pgx.ErrNoRows) {
688 return "", "", "", users.ErrUserNotFound
689 }
690 return userID, hash, subToken, err
691}
692
693// GetAdminUser 返回第一个 is_admin=true 的用户。
694func (s *UserStore) GetAdminUser() (users.User, error) {

Callers

nothing calls this directly

Calls 1

QueryRowMethod · 0.80

Tested by

no test coverage detected