Add Prod Build
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user