-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from jinaga/navigation-lifecycle
Navigation lifecycle manager
- Loading branch information
Showing
35 changed files
with
640 additions
and
306 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
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,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(); | ||
} | ||
} |
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 @@ | ||
namespace Jinaga.Maui.Authentication; | ||
|
||
public record AuthenticationResult(AuthenticationToken? Token, User? User) | ||
{ | ||
public static AuthenticationResult Empty = new(null, null); | ||
} |
Oops, something went wrong.