Skip to content

Commit

Permalink
Posibility to change config per context
Browse files Browse the repository at this point in the history
  • Loading branch information
glucaci committed Oct 6, 2022
1 parent 45384b6 commit 8ab5124
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Storage.MongoDB/BewitAuthorizationBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
using System;
using Microsoft.Extensions.Configuration;
using MongoDB.Driver;
#nullable enable

namespace Bewit.Storage.MongoDB
{
public static class BewitAuthorizationBuilderExtensions
{
public static void UseMongoPersistence(
this BewitPayloadContext context,
IConfiguration configuration)
IConfiguration configuration,
Action<MongoNonceOptions>? configure = default)
{
MongoNonceOptions options = configuration
.GetSection("Bewit:Mongo")
.Get<MongoNonceOptions>();

configure?.Invoke(options);

context.UseMongoPersistence(options);
}

Expand Down

0 comments on commit 8ab5124

Please sign in to comment.