Skip to content

Commit

Permalink
Fixes session scope handling for CORS Policy Service (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodall committed Sep 29, 2020
1 parent f4dac9e commit 18c8a12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public async Task<bool> IsOriginAllowedAsync(string origin)
{
bool isAllowed;

using (var session = _context.HttpContext.RequestServices.GetRequiredService<IStatelessSession>())
var session = _context.HttpContext.RequestServices.GetRequiredService<IStatelessSession>();
using (var tx = session.BeginTransaction())
{
ClientCorsOrigin corsOriginAlias = null;
var corsOriginsQuery = session.QueryOver<Client>()
Expand All @@ -51,6 +52,7 @@ public async Task<bool> IsOriginAllowedAsync(string origin)
));

var origins = await corsOriginsQuery.ListAsync<string>();
await tx.CommitAsync();

isAllowed = origins.Any();
}
Expand Down
11 changes: 10 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Build 2.1.2
_Release notes - IdentityServer4.NHibernate - Version 2.1.2_

__New features__
- None

__Resolved Issues__
- [#11](https://github.com/albertodall/IdentityServer4.NHibernate/issues/11) - Session is closed exception ([@lcetinapta](https://github.com/lcetinapta))

## Build 2.1.1
_Release notes - IdentityServer4.NHibernate - Version 2.1.0_
_Release notes - IdentityServer4.NHibernate - Version 2.1.1_

__New features__
- None
Expand Down

0 comments on commit 18c8a12

Please sign in to comment.