connected remotegameprivate and backend

This commit is contained in:
2023-02-24 15:41:40 +00:00
parent 574317d286
commit 0fadadee2d
24 changed files with 2101 additions and 151 deletions

26
server/login.go Normal file
View File

@@ -0,0 +1,26 @@
package server
import (
"errors"
"github.com/Akilan1999/remotegameplay/server/auth"
"gorm.io/gorm"
)
func AuthLogin(db *gorm.DB, user *Users) (string, error) {
// Generate Hash from password
password, err := auth.HashPassword(user.Password)
if err != nil {
return "", err
}
match, err := CheckIfEmailAndPasswordMatch(db, user.EmailID, password)
if err != nil {
return "", err
}
if match == "success" {
return "success", nil
}
return "", errors.New("Something is wrong with from our side. Email us: me@akilan.io to find out more. ")
}