feat: 兼容 SignalR 的 access_token 参数
This commit is contained in:
parent
907e89f973
commit
a1e6b5bd58
@ -60,6 +60,10 @@ public class Startup : AppStartup
|
||||
// 若请求 Url 包含 token 参数,则设置 Token 值
|
||||
if (httpContext.Request.Query.ContainsKey("token"))
|
||||
context.Token = httpContext.Request.Query["token"];
|
||||
// 若请求 Url 包含 access_token 参数,则设置 Token 值
|
||||
// 兼容 SignalR 通过 accessTokenFactory 传入的 token 值 .withUrl("/hubs/xxx", { accessTokenFactory: () => this.loginToken })
|
||||
if (httpContext.Request.Query.ContainsKey("access_token"))
|
||||
context.Token = httpContext.Request.Query["access_token"];
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user