Skip to content

Commit

Permalink
fix: use less singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
ontehfritz committed Dec 23, 2024
1 parent 47b0b3b commit c830da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bulwark.Auth/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@
};

applicationBuilder.Services.AddSingleton(passwordPolicy);
applicationBuilder.Services.AddSingleton<JwtTokenizer>(t => new JwtTokenizer("bulwark", "bulwark",
applicationBuilder.Services.AddTransient<JwtTokenizer>(t => new JwtTokenizer("bulwark", "bulwark",
appConfig.AccessTokenExpireInSeconds, appConfig.RefreshTokenExpireInSeconds,
signingAlgorithms, t.GetService<SigningKey>()));
applicationBuilder.Services.AddSingleton(mongoClient.GetDatabase(dbName));
applicationBuilder.Services.AddTransient<ITokenRepository, MongoDbAuthToken>();
applicationBuilder.Services.AddTransient<ISigningKeyRepository, MongoDbSigningKey>();
applicationBuilder.Services.AddTransient<IEncrypt, BulwarkBCrypt>();
applicationBuilder.Services.AddSingleton<SigningKey>();
applicationBuilder.Services.AddTransient<SigningKey>();
applicationBuilder.Services.AddTransient<IAccountRepository, MongoDbAccount>();
applicationBuilder.Services.AddTransient<Account>();
applicationBuilder.Services.AddTransient<Authentication>();
Expand Down

0 comments on commit c830da8

Please sign in to comment.