This repository was archived by the owner on Apr 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +36
-0
lines changed
AspNetCore.IdpSample/Pages
AspNetCore.SpSample/Pages Expand file tree Collapse file tree 6 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ @page
2+ @model AspNetCore .IdpSample .Pages .Logout
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
2+ using Microsoft . AspNetCore . Authentication ;
3+ using Microsoft . AspNetCore . Mvc ;
4+ using Microsoft . AspNetCore . Mvc . RazorPages ;
5+
6+ namespace AspNetCore . IdpSample . Pages ;
7+
8+ public class Logout : PageModel
9+ {
10+ public async Task < IActionResult > OnGetAsync ( )
11+ {
12+ await HttpContext . SignOutAsync ( ) ;
13+ return Redirect ( "/" ) ;
14+ }
15+ }
Original file line number Diff line number Diff line change 4343 <span class =" navbar-text" >
4444 @( Context .User .FindFirst (System .Security .Claims .ClaimTypes .NameIdentifier )? .Value ?? " " )
4545 </span >
46+ <a class =" nav-link text-dark" asp-area =" " asp-page =" /Logout" >Logout </a >
4647 }
4748 </div >
4849 </div >
Original file line number Diff line number Diff line change 1+ @page
2+ @model AspNetCore .SpSample .Pages .Logout
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
2+ using Microsoft . AspNetCore . Authentication ;
3+ using Microsoft . AspNetCore . Mvc ;
4+ using Microsoft . AspNetCore . Mvc . RazorPages ;
5+
6+ namespace AspNetCore . SpSample . Pages ;
7+
8+ public class Logout : PageModel
9+ {
10+ public async Task < IActionResult > OnGetAsync ( )
11+ {
12+ await HttpContext . SignOutAsync ( ) ;
13+ return Redirect ( "/" ) ;
14+ }
15+ }
Original file line number Diff line number Diff line change 4343 <span class =" navbar-text" >
4444 @( Context .User .FindFirst (System .Security .Claims .ClaimTypes .NameIdentifier )? .Value ?? " " )
4545 </span >
46+ <a class =" nav-link text-dark" asp-area =" " asp-page =" /Logout" >Logout </a >
4647 }
4748 </div >
4849
You can’t perform that action at this time.
0 commit comments