feat: 完成支持鉴权刷新功能
This commit is contained in:
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Security.Claims;
|
||||
using Yi.Framework.Core.Authentication;
|
||||
using Yi.Framework.Rbac.Domain.Managers;
|
||||
using Yi.Framework.Rbac.Domain.Shared.Consts;
|
||||
|
||||
@@ -45,16 +46,12 @@ namespace Yi.Framework.Rbac.Domain.Authorization
|
||||
context.Response.Headers["access_token"] = access_Token;
|
||||
context.Response.Headers["refresh_token"] = refresh_Token;
|
||||
|
||||
|
||||
//请求头替换,补充后续鉴权逻辑
|
||||
context.Request.Headers["Authorization"] = "Bearer " + access_Token;
|
||||
|
||||
//刷新鉴权状态
|
||||
context.RefreshAuthentication();
|
||||
}
|
||||
//刷新token 与 access_token都失效了
|
||||
// else
|
||||
// {
|
||||
//context.Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||
//return;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user