Skip to content

Commit 22c504f

Browse files
committed
Client Blazor Tests
1 parent e4bb63b commit 22c504f

48 files changed

Lines changed: 1166 additions & 161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore/Components/Pages/Home.razor.cs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CodeBeam.UltimateAuth.Client.Blazor;
33
using CodeBeam.UltimateAuth.Client.Runtime;
44
using CodeBeam.UltimateAuth.Core.Contracts;
5+
using CodeBeam.UltimateAuth.Core.Defaults;
56
using CodeBeam.UltimateAuth.Core.Domain;
67
using CodeBeam.UltimateAuth.Server.Stores;
78
using MudBlazor;
@@ -143,10 +144,10 @@ private async Task<string> ResolveReturnUrlAsync()
143144
var uri = Nav.ToAbsoluteUri(Nav.Uri);
144145
var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
145146

146-
if (query.TryGetValue("return_url", out var ru) && !string.IsNullOrWhiteSpace(ru))
147+
if (query.TryGetValue(UAuthConstants.Query.ReturnUrl, out var ru) && !string.IsNullOrWhiteSpace(ru))
147148
return ru!;
148149

149-
if (query.TryGetValue("hub", out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150+
if (query.TryGetValue(UAuthConstants.Query.Hub, out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150151
{
151152
var artifact = await AuthStore.GetAsync(new AuthArtifactKey(hubKey!));
152153
if (artifact is HubFlowArtifact flow && !string.IsNullOrWhiteSpace(flow.ReturnUrl))

‎samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/Components/Pages/Home.razor.cs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CodeBeam.UltimateAuth.Client.Blazor;
33
using CodeBeam.UltimateAuth.Client.Runtime;
44
using CodeBeam.UltimateAuth.Core.Contracts;
5+
using CodeBeam.UltimateAuth.Core.Defaults;
56
using CodeBeam.UltimateAuth.Core.Domain;
67
using CodeBeam.UltimateAuth.Server.Stores;
78
using MudBlazor;
@@ -143,10 +144,10 @@ private async Task<string> ResolveReturnUrlAsync()
143144
var uri = Nav.ToAbsoluteUri(Nav.Uri);
144145
var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
145146

146-
if (query.TryGetValue("return_url", out var ru) && !string.IsNullOrWhiteSpace(ru))
147+
if (query.TryGetValue(UAuthConstants.Query.ReturnUrl, out var ru) && !string.IsNullOrWhiteSpace(ru))
147148
return ru!;
148149

149-
if (query.TryGetValue("hub", out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150+
if (query.TryGetValue(UAuthConstants.Query.Hub, out var hubKey) && !string.IsNullOrWhiteSpace(hubKey))
150151
{
151152
var artifact = await AuthStore.GetAsync(new AuthArtifactKey(hubKey!));
152153
if (artifact is HubFlowArtifact flow && !string.IsNullOrWhiteSpace(flow.ReturnUrl))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/authorized-test"
22
@attribute [UAuthAuthorize]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
66
<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,6 +1,6 @@
11
@page "/home"
22
@attribute [UAuthAuthorize]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
@inject IUAuthClient UAuthClient
66
@inject UAuthClientDiagnostics Diagnostics

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore.Components.Pages;
1414

15-
public partial class Home : UAuthFlowPageBase
15+
public partial class Home : UAuthPageBase
1616
{
1717
private string _selectedAuthState = "UAuthState";
1818
private ClaimsPrincipal? _aspNetCoreState;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@page "/login"
22
@attribute [UAuthLoginPage]
3-
@inherits UAuthFlowPageBase
3+
@inherits UAuthPageBase
44

55
@implements IDisposable
66
@inject IUAuthClient UAuthClient

‎samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/Components/Pages/Login.razor.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore.Components.Pages;
99

10-
public partial class Login : UAuthFlowPageBase
10+
public partial class Login : UAuthPageBase
1111
{
1212
private string? _username;
1313
private string? _password;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/register"
2-
@inherits UAuthFlowPageBase
2+
@inherits UAuthPageBase
33

44
@implements IDisposable
55
@inject IUAuthClient UAuthClient

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/reset"
2-
@inherits UAuthFlowPageBase
2+
@inherits UAuthPageBase
33

44
@inject IUAuthClient UAuthClient
55
@inject ISnackbar Snackbar

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@page "/authorized-test"
22
@using CodeBeam.UltimateAuth.Core.Defaults
33
@attribute [UAuthAuthorize]
4-
@inherits UAuthFlowPageBase
4+
@inherits UAuthPageBase
55

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

0 commit comments

Comments
 (0)