summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs')
-rw-r--r--slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs b/slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs
new file mode 100644
index 0000000..94ae726
--- /dev/null
+++ b/slips/src/app/Marina/Presentation/Presenters/LoginPresenter.cs
@@ -0,0 +1,34 @@
+using Marina.Infrastructure.Container;
+using Marina.Presentation.Mappers;
+using Marina.Presentation.Views;
+using Marina.Task;
+using Marina.Web;
+
+namespace Marina.Presentation.Presenters {
+ public class LoginPresenter : ILoginPresenter {
+ public LoginPresenter( ILoginView view )
+ : this(
+ view,
+ Resolve.DependencyFor< IHttpRequest >( ),
+ Resolve.DependencyFor< IAuthenticationTask >( ),
+ Resolve.DependencyFor< ILoginCredentialsMapper >( )
+ ) {}
+
+ public LoginPresenter( ILoginView view, IHttpRequest request, IAuthenticationTask task,
+ ILoginCredentialsMapper mapper ) {
+ _view = view;
+ _request = request;
+ _task = task;
+ _mapper = mapper;
+ }
+
+ public void Login() {
+ _view.Display( _task.AuthenticateUserUsing( _mapper.MapFrom( _request ) ) );
+ }
+
+ private readonly ILoginView _view;
+ private readonly IHttpRequest _request;
+ private readonly IAuthenticationTask _task;
+ private readonly ILoginCredentialsMapper _mapper;
+ }
+} \ No newline at end of file