-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,559 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<base href="/" /> | ||
<link rel="stylesheet" href="app.css" /> | ||
<link rel="icon" type="image/png" href="favicon.png" /> | ||
<HeadOutlet /> | ||
</head> | ||
|
||
<body> | ||
<Routes /> | ||
<script src="_framework/blazor.web.js"></script> | ||
</body> | ||
|
||
</html> |
3 changes: 3 additions & 0 deletions
3
apps/dashboard/PaperBoy.Dashboard/Components/Layout/MainLayout.razor
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,3 @@ | ||
@inherits LayoutComponentBase | ||
|
||
@Body |
4 changes: 4 additions & 0 deletions
4
apps/dashboard/PaperBoy.Dashboard/Components/Pages/Home.razor
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 @@ | ||
@page "/" | ||
@attribute [Authorize] | ||
|
||
<h1>Hello world</h1> |
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,6 @@ | ||
<Router AppAssembly="typeof(Program).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" /> | ||
<FocusOnNavigate RouteData="routeData" Selector="h1" /> | ||
</Found> | ||
</Router> |
11 changes: 11 additions & 0 deletions
11
apps/dashboard/PaperBoy.Dashboard/Components/_Imports.razor
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,11 @@ | ||
@using System.Net.Http | ||
@using System.Net.Http.Json | ||
@using Microsoft.AspNetCore.Authorization | ||
@using Microsoft.AspNetCore.Components.Forms | ||
@using Microsoft.AspNetCore.Components.Routing | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using static Microsoft.AspNetCore.Components.Web.RenderMode | ||
@using Microsoft.AspNetCore.Components.Web.Virtualization | ||
@using Microsoft.JSInterop | ||
@using PaperBoy.Dashboard | ||
@using PaperBoy.Dashboard.Components |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,51 @@ | ||
using Auth0.AspNetCore.Authentication; | ||
using Microsoft.AspNetCore.Authentication; | ||
using Microsoft.AspNetCore.Authentication.Cookies; | ||
using PaperBoy.Dashboard.Components; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.Services.AddAuth0WebAppAuthentication(options => | ||
{ | ||
options.Domain = builder.Configuration["Auth0:Domain"]!; | ||
options.ClientId = builder.Configuration["Auth0:ClientId"]!; | ||
options.ClientSecret = builder.Configuration["Auth0:ClientSecret"]!; | ||
options.Scope = "openid profile email"; | ||
}); | ||
|
||
builder.Services.AddAntiforgery(); | ||
|
||
builder.Services.AddRazorComponents().AddInteractiveServerComponents(); | ||
|
||
var app = builder.Build(); | ||
|
||
app.MapGet("/", () => "Hello World!"); | ||
app.UseStaticFiles(); | ||
|
||
app.UseRouting(); | ||
app.UseAntiforgery(); | ||
|
||
app.UseAuthentication(); | ||
app.UseAuthorization(); | ||
|
||
app.MapGet("/Account/Login", async (HttpContext HttpContext, string returnUrl = "/") => | ||
{ | ||
var authenticationProperties = new LoginAuthenticationPropertiesBuilder() | ||
.WithRedirectUri(returnUrl) | ||
.Build(); | ||
|
||
await HttpContext.ChallengeAsync(Auth0Constants.AuthenticationScheme, authenticationProperties); | ||
}); | ||
|
||
app.MapGet("/Account/Logout", async (HttpContext HttpContext) => | ||
{ | ||
var authenticationProperties = new LoginAuthenticationPropertiesBuilder() | ||
.WithRedirectUri("/") | ||
.Build(); | ||
|
||
await HttpContext.SignOutAsync(Auth0Constants.AuthenticationScheme, authenticationProperties); | ||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); | ||
}); | ||
|
||
app.MapRazorComponents<App>().AddInteractiveServerRenderMode(); | ||
|
||
app.Run(); |
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,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
Oops, something went wrong.