Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
ProjectsStatusManagement
Commits
22786e30
Commit
22786e30
authored
Aug 25, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix roles loading issues
parent
ab64adee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
AuthenticationService.cs
...nt.Infrastructure/Authentication/AuthenticationService.cs
+2
-0
No files found.
PSManagement.Infrastructure/Authentication/AuthenticationService.cs
View file @
22786e30
...
@@ -30,6 +30,7 @@ namespace PSManagement.Infrastructure.Services.Authentication
...
@@ -30,6 +30,7 @@ namespace PSManagement.Infrastructure.Services.Authentication
public
async
Task
<
Result
<
AuthenticationResult
>>
Login
(
String
email
,
String
password
)
{
public
async
Task
<
Result
<
AuthenticationResult
>>
Login
(
String
email
,
String
password
)
{
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
AddInclude
(
e
=>
e
.
Roles
);
User
u
=
await
_userRepository
.
GetByEmail
(
email
,
_specification
);
User
u
=
await
_userRepository
.
GetByEmail
(
email
,
_specification
);
if
(
u
is
null
||
u
.
HashedPassword
!=
password
)
{
if
(
u
is
null
||
u
.
HashedPassword
!=
password
)
{
...
@@ -43,6 +44,7 @@ namespace PSManagement.Infrastructure.Services.Authentication
...
@@ -43,6 +44,7 @@ namespace PSManagement.Infrastructure.Services.Authentication
Email
=
u
.
Email
,
Email
=
u
.
Email
,
FirstName
=
u
.
Employee
.
PersonalInfo
.
FirstName
,
FirstName
=
u
.
Employee
.
PersonalInfo
.
FirstName
,
LastName
=
u
.
Employee
.
PersonalInfo
.
LastName
,
LastName
=
u
.
Employee
.
PersonalInfo
.
LastName
,
Roles
=
_mapper
.
Map
<
ICollection
<
RoleDTO
>>(
u
.
Roles
),
Token
=
token
};
Token
=
token
};
}
}
public
async
Task
<
Result
<
AuthenticationResult
>>
Register
(
String
email
,
String
userName
,
String
password
)
{
public
async
Task
<
Result
<
AuthenticationResult
>>
Register
(
String
email
,
String
userName
,
String
password
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment