Remove user authentication and switch to simple admin password check (It wont have more than one admin user so no need for registeration (I LOVE .Net/C# btw))
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"CatsOfMastodonBotGo/internal/models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
|
||||
func NewUserService(db *gorm.DB) *UserService {
|
||||
return &UserService{db: db}
|
||||
}
|
||||
|
||||
func (us *UserService) CreateUser(user models.ComUser) int {
|
||||
return int(us.db.Create(&user).RowsAffected)
|
||||
}
|
||||
|
||||
func (us *UserService) GetUserByUsername(username string) models.ComUser {
|
||||
var user models.ComUser
|
||||
us.db.Where("username = ?", username).First(&user)
|
||||
return user
|
||||
}
|
||||
Reference in New Issue
Block a user