feat(auth): add user information update feature and refactor the authentication service.

This commit is contained in:
ShiYu
2025-05-20 20:43:08 +08:00
parent 2c73fc29df
commit ceeab55ce9
9 changed files with 490 additions and 246 deletions

View File

@@ -0,0 +1,18 @@
using Foxel.Models.DataBase;
using Foxel.Models.Request;
using Foxel.Models.Request.Auth;
namespace Foxel.Services.Interface;
public interface IAuthService
{
Task<(bool success, string message, User? user)> RegisterUserAsync(RegisterRequest request);
Task<(bool success, string message, User? user)> AuthenticateUserAsync(LoginRequest request);
Task<string> GenerateJwtTokenAsync(User user);
Task<User?> GetUserByIdAsync(int userId);
Task<(bool success, string message, User? user)> FindOrCreateGitHubUserAsync(
string githubId, string? githubName, string? email);
Task<(bool success, string message, User? user)> UpdateUserInfoAsync(int userId, UpdateUserRequest request);
string GetGitHubLoginUrl();
Task<(bool success, string message, string? token)> ProcessGitHubCallbackAsync(string code);
}