Add Prod Build

This commit is contained in:
aditya.siregar
2024-09-03 23:44:57 +07:00
parent 572828cf73
commit dc2df93572
8 changed files with 123 additions and 5 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"furtuna-be/internal/constants/role"
"net/http"
"strings"
"github.com/gin-gonic/gin"
@@ -48,7 +49,8 @@ func (h *AuthHandler) AuthLogin(c *gin.Context) {
return
}
authUser, err := h.service.AuthenticateUser(c, bodyParam.Email, bodyParam.Password)
email := strings.ToLower(bodyParam.Email)
authUser, err := h.service.AuthenticateUser(c, email, bodyParam.Password)
if err != nil {
response.ErrorWrapper(c, err)
return
+3 -2
View File
@@ -3,6 +3,7 @@ package customerauth
import (
"fmt"
"net/http"
"strings"
"github.com/gin-gonic/gin"
@@ -49,8 +50,8 @@ func (h *AuthHandler) AuthLogin(c *gin.Context) {
response.ErrorWrapper(c, errors.ErrorBadRequest)
return
}
authUser, err := h.service.AuthenticateUser(c, bodyParam.Email, bodyParam.Password)
email := strings.ToLower(bodyParam.Email)
authUser, err := h.service.AuthenticateUser(c, email, bodyParam.Password)
if err != nil {
response.ErrorWrapper(c, err)
return
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"furtuna-be/internal/constants/role"
"furtuna-be/internal/entity"
"github.com/go-playground/validator/v10"
"strings"
)
type User struct {
@@ -35,7 +36,7 @@ func (u *User) ToEntity(ctx mycontext.Context, userType string) *entity.User {
return &entity.User{
Name: u.Name,
Email: u.Email,
Email: strings.ToLower(u.Email),
Password: u.Password,
RoleID: role.Role(u.RoleID),
PartnerID: u.PartnerID,
@@ -131,7 +132,7 @@ func (e *UserRegister) Validate() error {
func (u *UserRegister) ToEntity() *entity.User {
return &entity.User{
Name: u.Name,
Email: u.Email,
Email: strings.ToLower(u.Email),
PhoneNumber: u.PhoneNumber,
Password: u.Password,
RoleID: role.Customer,