-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from abpframework/master
Merging master
- Loading branch information
Showing
19 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUserSynchronizer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Threading.Tasks; | ||
using Volo.Abp.DependencyInjection; | ||
using Volo.Abp.Domain.Entities.Events.Distributed; | ||
using Volo.Abp.EventBus.Distributed; | ||
using Volo.Abp.Users; | ||
|
||
namespace Volo.Blogging.Users | ||
{ | ||
public class BlogUserSynchronizer : | ||
IDistributedEventHandler<EntityUpdatedEto<UserEto>>, | ||
ITransientDependency | ||
{ | ||
protected IBlogUserRepository UserRepository { get; } | ||
protected IBlogUserLookupService UserLookupService { get; } | ||
|
||
public BlogUserSynchronizer(IBlogUserRepository userRepository, IBlogUserLookupService userLookupService) | ||
{ | ||
UserRepository = userRepository; | ||
UserLookupService = userLookupService; | ||
} | ||
|
||
public async Task HandleEventAsync(EntityUpdatedEto<UserEto> eventData) | ||
{ | ||
var user = await UserRepository.FindAsync(eventData.Entity.Id); | ||
if (user == null) | ||
{ | ||
//TODO: Why needed (ask to @ebicoglu)? | ||
user = await UserLookupService.FindByIdAsync(eventData.Entity.Id); | ||
if (user == null) | ||
{ | ||
return; | ||
} | ||
} | ||
|
||
user.Update(eventData.Entity); | ||
await UserRepository.UpdateAsync(user); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
@page | ||
@using Volo.Abp.Users | ||
@model PublicWebSite.Host.Pages.IndexModel | ||
@inject ICurrentUser CurrentUser | ||
<h1>Public Web Site Application</h1> | ||
<h2 class="lead">Welcome...</h2> | ||
<h2 class="lead">Welcome...</h2> | ||
|
||
@if (CurrentUser.IsAuthenticated) | ||
{ | ||
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">Logout</a> | ||
} | ||
else | ||
{ | ||
<form method="POST"> | ||
<input type="submit" asp-page-handler="Login" value="Login" /> | ||
</form> | ||
} |
15 changes: 9 additions & 6 deletions
15
samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.AspNetCore.Authentication; | ||
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; | ||
|
||
namespace PublicWebSite.Host.Pages | ||
{ | ||
public class IndexModel : PageModel | ||
public class IndexModel : AbpPageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
|
||
} | ||
|
||
public async Task OnPostLoginAsync() | ||
{ | ||
await HttpContext.ChallengeAsync("oidc"); | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Products.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/_ViewImports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI | ||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap | ||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling |
Binary file added
BIN
+400 KB
...lications/PublicWebSite.Host/wwwroot/files/ec882345a403be325bc539ebda211e79.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters