From 9af16dc48cf90a5762c3104c08c1aef8d5c29774 Mon Sep 17 00:00:00 2001 From: duykasama Date: Sun, 17 Mar 2024 14:44:30 +0700 Subject: [PATCH] [Hotfix][Duy] Return user information when logging in --- Domus.Service/Implementations/AuthService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Domus.Service/Implementations/AuthService.cs b/Domus.Service/Implementations/AuthService.cs index 39ae410..fbe3e95 100644 --- a/Domus.Service/Implementations/AuthService.cs +++ b/Domus.Service/Implementations/AuthService.cs @@ -2,6 +2,7 @@ using AutoMapper; using Domus.Common.Helpers; using Domus.DAL.Interfaces; +using Domus.Domain.Dtos; using Domus.Domain.Entities; using Domus.Service.Constants; using Domus.Service.Exceptions; @@ -73,7 +74,8 @@ public async Task LoginAsync(LoginRequest request) } }; - return new ServiceActionResult(true) { Data = response }; + var returnedUser = _mapper.Map(user); + return new ServiceActionResult(true) { Data = new { userInfo = returnedUser, token = response } }; } public async Task RefreshTokenAsync(RefreshTokenRequest request)