chores: refactor struct and structure project
This commit is contained in:
@@ -4,12 +4,13 @@ import (
|
||||
"errors"
|
||||
|
||||
authdomain "legalgo-BE-go/internal/domain/auth"
|
||||
userdomain "legalgo-BE-go/internal/domain/user"
|
||||
"legalgo-BE-go/internal/utilities/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func (a *AuthSvc) LoginAsUser(spec authdomain.LoginReq) (string, error) {
|
||||
func (a *impl) LoginAsUser(spec userdomain.UserLogin) (string, error) {
|
||||
user, err := a.userRepo.GetUserByEmail(spec.Email)
|
||||
if err != nil {
|
||||
return "", errors.New(err.Error())
|
||||
@@ -23,6 +24,7 @@ func (a *AuthSvc) LoginAsUser(spec authdomain.LoginReq) (string, error) {
|
||||
authToken := authdomain.AuthToken{
|
||||
Email: user.Email,
|
||||
SessionID: uuid.NewString(),
|
||||
Role: "user",
|
||||
}
|
||||
|
||||
token, err := utils.GenerateToken(authToken)
|
||||
|
||||
Reference in New Issue
Block a user