- 新增 API 端 JWT 登录、refresh token 轮换和退出登录流程 - 新增 refresh token 实体、DbSet 配置和 EF Core 迁移 - 新增 PC 端授权码登录、本地全局 token 刷新、登出和鉴权服务 - 扩展统一端点模型,支持宿主过滤、角色鉴权、OpenAPI 元数据和 DI 服务处理器 - API 启用 JwtBearer 认证、Swagger UI 和认证端点注册 - PC 端注册认证服务,并按宿主过滤桌面拦截端点
24 lines
614 B
C#
24 lines
614 B
C#
using Avalonia_Services.Core;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Avalonia_Services.Services.AuthService
|
|
{
|
|
public interface IApiAuthEndpointService
|
|
{
|
|
Task<object?> LoginAsync(ServiceEndpointContext ctx);
|
|
|
|
Task<object?> RefreshAsync(ServiceEndpointContext ctx);
|
|
|
|
Task<object?> LogoutAsync(ServiceEndpointContext ctx);
|
|
}
|
|
|
|
public interface IPcAuthEndpointService
|
|
{
|
|
Task<object?> AuthorizeAsync(ServiceEndpointContext ctx);
|
|
|
|
Task<object?> RefreshAsync(ServiceEndpointContext ctx);
|
|
|
|
Task<object?> LogoutAsync(ServiceEndpointContext ctx);
|
|
}
|
|
}
|