Skip to content

Commit b86616f

Browse files
authored
Added UAuthAuthorize Attribute (#43)
* Added UAuthAuthorize Attribute * Arrange Samples
1 parent 49eaac5 commit b86616f

13 files changed

Lines changed: 85 additions & 14 deletions

File tree

Binary file not shown.
Binary file not shown.

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/AuthorizedTestPage.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/authorized-test"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
3+
@inherits UAuthFlowPageBase
34

45
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
56
<MudPaper Class="pa-8" Style="max-width: 520px; width: 100%;" Elevation="0" Outlined="true">

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/Home.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/home"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
33
@inherits UAuthFlowPageBase
44

55
@inject IUAuthClient UAuthClient

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Pages/AuthorizedTestPage.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/authorized-test"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
3+
@inherits UAuthFlowPageBase
34

45
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
56
<MudPaper Class="pa-8" Style="max-width: 520px; width: 100%;" Elevation="0" Outlined="true">
@@ -13,7 +14,7 @@
1314
</MudText>
1415

1516
<MudStack Row="true" Spacing="2" Class="mt-2">
16-
<MudButton Href="/home" Color="Color.Primary" Variant="Variant.Filled">Go Profile</MudButton>
17+
<MudButton Href="/home" Color="Color.Primary" Variant="Variant.Filled">Go Home Page</MudButton>
1718
</MudStack>
1819

1920
<MudDivider Class="my-2" />

samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/Components/Pages/Home.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/home"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
33
@inherits UAuthFlowPageBase
44

55
@inject IUAuthClient UAuthClient

samples/blazor-standalone-wasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm/Pages/AuthorizedTestPage.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/authorized-test"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
3+
@inherits UAuthFlowPageBase
34

45
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
56
<MudPaper Class="pa-8" Style="max-width: 520px; width: 100%;" Elevation="0" Outlined="true">

samples/blazor-standalone-wasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm/Pages/Home.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/home"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
33
@inherits UAuthFlowPageBase
44

55
@inject IUAuthClient UAuthClient

samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/AuthorizedTestPage.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/authorized-test"
2-
@attribute [Authorize]
2+
@attribute [UAuthAuthorize]
3+
@inherits UAuthFlowPageBase
34

45
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
56
<MudPaper Class="pa-8" Style="max-width: 520px; width: 100%;" Elevation="0" Outlined="true">
@@ -13,7 +14,7 @@
1314
</MudText>
1415

1516
<MudStack Row="true" Spacing="2" Class="mt-2">
16-
<MudButton Href="/home" Color="Color.Primary" Variant="Variant.Filled">Go Profile</MudButton>
17+
<MudButton Href="/home" Color="Color.Primary" Variant="Variant.Filled">Go Home Page</MudButton>
1718
</MudStack>
1819

1920
<MudDivider Class="my-2" />

samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/Pages/Home.razor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@page "/home"
2-
@* To make Authorize attribute to work, add ResourceApi in Program.cs, but it affects performance significantly *@
3-
@* @attribute [Authorize] *@
2+
@attribute [UAuthAuthorize]
43
@inherits UAuthFlowPageBase
54

65
@inject IUAuthClient UAuthClient

0 commit comments

Comments
 (0)