aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Startup.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-24 22:01:27 +0800
committercrupest <crupest@outlook.com>2021-04-24 22:01:27 +0800
commit7c37a5885437aaf97b9986b7cc2941b5e4316003 (patch)
treec3b9b733e269b4f187f24a12dc08e1f1c88bd7a6 /BackEnd/Timeline/Startup.cs
parent6877db6a535e57fd1d7e01c966a6451dc6f186f0 (diff)
downloadtimeline-7c37a5885437aaf97b9986b7cc2941b5e4316003.tar.gz
timeline-7c37a5885437aaf97b9986b7cc2941b5e4316003.tar.bz2
timeline-7c37a5885437aaf97b9986b7cc2941b5e4316003.zip
refactor: Move token services.
Diffstat (limited to 'BackEnd/Timeline/Startup.cs')
-rw-r--r--BackEnd/Timeline/Startup.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/BackEnd/Timeline/Startup.cs b/BackEnd/Timeline/Startup.cs
index c2134a94..d4fffb51 100644
--- a/BackEnd/Timeline/Startup.cs
+++ b/BackEnd/Timeline/Startup.cs
@@ -22,6 +22,7 @@ using Timeline.Models.Mapper;
using Timeline.Routes;
using Timeline.Services;
using Timeline.Services.DatabaseManagement;
+using Timeline.Services.Token;
using Timeline.Swagger;
namespace Timeline
@@ -78,7 +79,6 @@ namespace Timeline
options.InvalidModelStateResponseFactory = InvalidModelResponseFactory.Factory;
});
- services.Configure<JwtConfiguration>(Configuration.GetSection("Jwt"));
services.AddAuthentication(AuthenticationConstants.Scheme)
.AddScheme<MyAuthenticationOptions, MyAuthenticationHandler>(AuthenticationConstants.Scheme, AuthenticationConstants.DisplayName, o => { });
services.AddAuthorization();
@@ -111,11 +111,11 @@ namespace Timeline
services.AddScoped<IUserService, UserService>();
services.AddScoped<IUserCredentialService, UserCredentialService>();
services.AddScoped<IUserDeleteService, UserDeleteService>();
- services.AddScoped<IUserTokenHandler, JwtUserTokenHandler>();
- services.AddScoped<IUserTokenManager, UserTokenManager>();
services.AddScoped<IUserPermissionService, UserPermissionService>();
services.AddUserAvatarService();
+ services.AddTokenService(Configuration);
+
services.AddScoped<IBasicTimelineService, BasicTimelineService>();
services.AddScoped<ITimelineService, TimelineService>();
services.AddScoped<ITimelinePostService, TimelinePostService>();