Apache2-REST

 view release on metacpan or  search on metacpan

lib/Apache2/REST/Handler/login.pm  view on Meta::CPAN

=head2 GET

Returns a uid and a authentication token

=cut

sub GET{
    my ( $self , $req , $resp ) = @_ ;
    
    my $email = $req->param('email') ;
    my $password = $req->param('password') ;
    
    ## DUMMY
    if ( $email ne 'fail'){
        my $uid = $SERIAL++ ;
        $resp->data()->{'uid'} = $uid ;
        $resp->data()->{'authentication'} = md5_hex($uid.'toto') ;
        return Apache2::Const::HTTP_OK ;
    }
    ## DUMMY FAILURE
    $resp->message('Authentication failed') ;



( run in 2.658 seconds using v1.01-cache-2.11-cpan-49f99fa48dc )