File Coverage

blib/lib/Articulate/Routes/Login.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Articulate::Routes::Login;
2 6     6   4029 use strict;
  6         14  
  6         330  
3 6     6   27 use warnings;
  6         9  
  6         138  
4              
5 6     6   30 use Moo;
  6         12  
  6         34  
6             with 'Articulate::Role::Routes';
7 6     6   2328 use Articulate::Syntax::Routes;
  6         18  
  6         42  
8 6     6   4624 use Articulate::Service;
  6         12  
  6         34  
9              
10             post '/login' => sub {
11             my ( $self, $request ) = @_;
12             my $user_id = $request->params->{'user_id'};
13             my $password = $request->params->{'password'};
14             my $redirect = $request->params->{'redirect'} // '/';
15             $self->service->process_request(
16             login => {
17             user_id => $user_id,
18             password => $password
19             }
20             );
21             };
22              
23             post '/logout' => sub {
24             my ( $self, $request ) = @_;
25             my $redirect = $request->params->{'redirect'} // '/';
26             $self->service->process_request( logout => {} );
27             };