Skip to content

Commit

Permalink
Merge pull request #125 from jinaga/navigation-lifecycle
Browse files Browse the repository at this point in the history
Navigation lifecycle manager
  • Loading branch information
michaellperry authored Jul 13, 2024
2 parents 66cddd7 + af145c0 commit b8fd0b5
Show file tree
Hide file tree
Showing 35 changed files with 640 additions and 306 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
with:
fetch-depth: "0"

- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.x.x

- name: Setup .NET Core 8
uses: actions/setup-dotnet@v1
with:
Expand Down
32 changes: 32 additions & 0 deletions Jinaga.Maui/Authentication/AuthenticationProviderProxy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Net.Http.Headers;
using Jinaga.Http;

namespace Jinaga.Maui.Authentication;

public class AuthenticationProviderProxy : IHttpAuthenticationProvider
{
private IHttpAuthenticationProvider? provider;

public void SetProvider(IHttpAuthenticationProvider provider)
{
this.provider = provider;
}

public void SetRequestHeaders(HttpRequestHeaders headers)
{
if (provider == null)
{
throw new Exception("No authentication provider is set.");
}
provider.SetRequestHeaders(headers);
}

public Task<JinagaAuthenticationState> Reauthenticate()
{
if (provider == null)
{
throw new Exception("No authentication provider is set.");
}
return provider.Reauthenticate();
}
}
6 changes: 6 additions & 0 deletions Jinaga.Maui/Authentication/AuthenticationResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Jinaga.Maui.Authentication;

public record AuthenticationResult(AuthenticationToken? Token, User? User)
{
public static AuthenticationResult Empty = new(null, null);
}
Loading

0 comments on commit b8fd0b5

Please sign in to comment.