Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lesson49
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Пасько Виталий
Lesson49
Commits
e6df9e62
Commit
e6df9e62
authored
Aug 14, 2022
by
Пасько Виталий
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: исправил ошибку, когда по email не удалось найти пользователя.
parent
81efc36c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
AccountService.cs
PhoneStore/Services/AccountService.cs
+11
-9
No files found.
PhoneStore/Services/AccountService.cs
View file @
e6df9e62
...
@@ -63,6 +63,8 @@ namespace PhoneStore.Services
...
@@ -63,6 +63,8 @@ namespace PhoneStore.Services
public
async
Task
<
IdentityResult
>
LogIn
(
LoginViewModel
model
)
public
async
Task
<
IdentityResult
>
LogIn
(
LoginViewModel
model
)
{
{
User
user
=
await
_userManager
.
FindByEmailAsync
(
model
.
Email
);
User
user
=
await
_userManager
.
FindByEmailAsync
(
model
.
Email
);
if
(
user
is
not
null
)
{
SignInResult
result
=
await
_signInManager
.
PasswordSignInAsync
(
SignInResult
result
=
await
_signInManager
.
PasswordSignInAsync
(
user
,
user
,
model
.
Password
,
model
.
Password
,
...
@@ -71,7 +73,7 @@ namespace PhoneStore.Services
...
@@ -71,7 +73,7 @@ namespace PhoneStore.Services
);
);
if
(
result
.
Succeeded
)
if
(
result
.
Succeeded
)
return
new
IdentityResult
{
StatusCodes
=
StatusCodes
.
Success
};
return
new
IdentityResult
{
StatusCodes
=
StatusCodes
.
Success
};
}
return
new
IdentityResult
return
new
IdentityResult
{
{
StatusCodes
=
StatusCodes
.
Error
,
StatusCodes
=
StatusCodes
.
Error
,
...
...
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