func (r *AuthRepository) GetUser(username string, password string) (user models.User, err error) {
	result := r.db.Where(&models.User{Username: username, Password: password}).First(&user)
	if result.Error != nil {
		err = errors.New("Invalid credentials")
	}
	return
}
GetUser returns specific user
package repositories
import (
	"errors"
	"github.com/bahattincinic/messenger-challenge/domain/models"
	"github.com/jinzhu/gorm"
)
type AuthRepository struct {
	db *gorm.DB
}
type IAuthRepository interface {
	CreateAccessToken(accessToken string, user models.User) models.Accesstoken
	GetUser(username string, password string) (user models.User, err error)
	CreateUser(username string, password string, fullname string) models.User
	CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
}
func NewAuthRepo(db *gorm.DB) *AuthRepository {
	return &AuthRepository{
		db: db,
	}
}
func (r *AuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken {
	var token = models.Accesstoken{
		Token:  accessToken,
		UserID: user.ID,
	}
	r.db.Create(&token)
	return token
}