-
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.
Merge branch 'feature/dashboard-page' into dev
- Loading branch information
Showing
33 changed files
with
957 additions
and
271 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
name: Build | ||
|
||
on: | ||
|
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,14 +1,29 @@ | ||
@page | ||
@page "/Logout" | ||
@attribute [IgnoreAntiforgeryToken] | ||
@inject SignInManager<IdentityUser> SignInManager | ||
@inject SignInManager<User> SignInManager | ||
|
||
@functions { | ||
|
||
public async Task<IActionResult> OnPost() | ||
{ | ||
await SignOut(); | ||
|
||
return Redirect("~/"); | ||
} | ||
|
||
public async Task<IActionResult> OnGet() | ||
{ | ||
await SignOut(); | ||
|
||
return Redirect("~/"); | ||
} | ||
|
||
private async Task SignOut() | ||
{ | ||
if (SignInManager.IsSignedIn(User)) | ||
{ | ||
await SignInManager.SignOutAsync(); | ||
} | ||
|
||
return Redirect("~/"); | ||
} | ||
} | ||
|
||
} |
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,4 +1,4 @@ | ||
@page | ||
@page "/Login" | ||
@using Microsoft.AspNetCore.Authentication | ||
@model LoginModel | ||
|
||
|
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,4 +1,4 @@ | ||
@page | ||
@page "/Register" | ||
@using Microsoft.AspNetCore.Authentication | ||
@model RegisterModel | ||
@{ | ||
|
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
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,21 @@ | ||
namespace ChatRPG.Data; | ||
|
||
public interface IFileUtility | ||
{ | ||
/// <summary> | ||
/// Updates the conversation save file asynchronously with the provided message pair. | ||
/// </summary> | ||
/// <param name="messages">A pair of messages (player and assistant) to save in the file.</param> | ||
/// <returns>A task representing the asynchronous file update process.</returns> | ||
Task UpdateSaveFileAsync(MessagePair messages); | ||
/// <summary> | ||
/// Retrieves the most recent conversation from a save file asynchronously, parsing and inserting | ||
/// into messages the player and assistant tags. | ||
/// </summary> | ||
/// <param name="playerTag">The tag to mark a player message.</param> | ||
/// <param name="assistantTag">The tag to mark an assistant message.</param> | ||
/// <returns>A list of messages representing the most recent conversation.</returns> | ||
Task<List<string>> GetMostRecentConversationAsync(string playerTag, string assistantTag); | ||
} | ||
|
||
public record MessagePair(string PlayerMessage, string AssistantMessage); |
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
Oops, something went wrong.