File tree Expand file tree Collapse file tree 5 files changed +16
-10
lines changed
samples/web/Liuliu.Demo.Web
OSharp.Identity/Authentication/JwtBearer Expand file tree Collapse file tree 5 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 22<package xmlns =" http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd" >
33 <metadata >
44 <id >OSharpNS</id >
5- <version >3.1.2-preview2.29 </version >
5+ <version >3.1.2-preview3-01 </version >
66 <title >OSharpFramework(.NETCoreApp3.1)</title >
77 <authors >柳柳软件(66soft.net)</authors >
88 <owners >柳柳软件(66soft.net)</owners >
1515 <tags >osharp osharpns</tags >
1616 <dependencies >
1717 <group targetFramework =" .NETCoreApp3.1" >
18- <dependency id =" OSharpNS.Core" version =" 3.1.2-preview2.29 " />
19- <dependency id =" OSharpNS.EntityFrameworkCore" version =" 3.1.2-preview2.29 " />
20- <dependency id =" OSharpNS.AutoMapper" version =" 3.1.2-preview2.29 " />
21- <dependency id =" OSharpNS.AspNetCore" version =" 3.1.2-preview2.29 " />
22- <dependency id =" OSharpNS.Log4Net" version =" 3.1.2-preview2.29 " />
18+ <dependency id =" OSharpNS.Core" version =" 3.1.2-preview3-01 " />
19+ <dependency id =" OSharpNS.EntityFrameworkCore" version =" 3.1.2-preview3-01 " />
20+ <dependency id =" OSharpNS.AutoMapper" version =" 3.1.2-preview3-01 " />
21+ <dependency id =" OSharpNS.AspNetCore" version =" 3.1.2-preview3-01 " />
22+ <dependency id =" OSharpNS.Log4Net" version =" 3.1.2-preview3-01 " />
2323 </group >
2424 </dependencies >
2525 </metadata >
Original file line number Diff line number Diff line change 33 <VersionMain >3.1</VersionMain >
44 <VersionPrefix >2</VersionPrefix >
55 <VersionSuffix >-preview</VersionSuffix >
6- <VersionSuffixVersion >2.29 </VersionSuffixVersion >
6+ <VersionSuffixVersion >3-01 </VersionSuffixVersion >
77 <Version >$(VersionMain).$(VersionPrefix)$(VersionSuffix)$(VersionSuffixVersion)</Version >
88 <AssemblyVersion >$(VersionMain).$(VersionPrefix)</AssemblyVersion >
99 <FileVersion >$(VersionMain).$(VersionSuffixVersion)</FileVersion >
Original file line number Diff line number Diff line change 2222 //,
2323 "MySql" : {
2424 "DbContextTypeName" : " OSharp.Entity.DefaultDbContext,OSharp.EntityFrameworkCore" ,
25- "ConnectionString" : " Server=127.0.0.1;UserId=root;Password=abc123456;Database=osharpns-dev2 ;charset='utf8';Allow User Variables=True" ,
25+ "ConnectionString" : " Server=127.0.0.1;UserId=root;Password=abc123456;Database=osharpns-dev ;charset='utf8';Allow User Variables=True" ,
2626 "DatabaseType" : " MySql" ,
2727 "LazyLoadingProxiesEnabled" : true ,
2828 "AuditEntityEnabled" : true ,
8787 "Audience" : " osharp angular demo" ,
8888 "Secret" : " {8619F7C3-B53C-4B85-99F0-983D351ECD82}" ,
8989 "AccessExpireMins" : 5 ,
90- "RefreshExpireMins" : 10080 // 7天
90+ "RefreshExpireMins" : 10080 , // 7天
91+ "IsRefreshAbsoluteExpired" : false
9192 },
9293 "Redis" : {
9394 "Configuration" : " localhost" ,
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ await _provider.ExecuteScopedWorkAsync(async provider =>
203203 }
204204 else
205205 {
206- if ( refreshToken == null )
206+ if ( refreshToken == null || ! options . IsRefreshAbsoluteExpired )
207207 {
208208 double minutes = options . RefreshExpireMins > 0 ? options . RefreshExpireMins : 10080 ; // 默认7天
209209 expires = now . AddMinutes ( minutes ) ;
Original file line number Diff line number Diff line change @@ -38,5 +38,10 @@ public class JwtOptions
3838 /// 获取或设置 RefreshToken有效期分钟数
3939 /// </summary>
4040 public double RefreshExpireMins { get ; set ; }
41+
42+ /// <summary>
43+ /// 获取或设置 RefreshToken是否绝对过期
44+ /// </summary>
45+ public bool IsRefreshAbsoluteExpired { get ; set ; } = true ;
4146 }
4247}
You can’t perform that action at this time.
0 commit comments