diff options
Diffstat (limited to 'lib/PAUSE')
-rw-r--r-- | lib/PAUSE/OpenID/Controller/Root.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/PAUSE/OpenID/Controller/Root.pm b/lib/PAUSE/OpenID/Controller/Root.pm index 33c8884..b3f2f4c 100644 --- a/lib/PAUSE/OpenID/Controller/Root.pm +++ b/lib/PAUSE/OpenID/Controller/Root.pm @@ -31,11 +31,27 @@ PAUSE::OpenID::Controller::Root - Root Controller for PAUSE::OpenID sub index :Path :Args(0) { my ( $self, $c ) = @_; + if ( not $c->req->param('openid.return_url') ) { + #$c->flash->{xml} = '<document><error_message>Missing parameter</error_message></document>'; + $c->res->redirect($c->uri_for('/error')); + } + $c->stash->{xml} =<<XML; <document/> XML + + # Pass through parameters (unchecked for now) + foreach my $key ( keys %{$c->req->params} ) { + $c->stash->{$key} = $c->req->param($key); + } - # Hello World + $c->forward('PAUSE::OpenID::View::XSLT'); +} + +sub error :Local { + my ( $self, $c ) = @_; + #$c->stash->{xml} = $c->flash->{xml}; + $c->stash->{xml} = '<document/>'; $c->forward('PAUSE::OpenID::View::XSLT'); } @@ -52,7 +68,7 @@ sub login :Local { my $username = $c->req->param('username'); my $password = $c->req->param('password'); - $c->log->debug('username "'.$username.'" login attemp'); + $c->log->debug('username "'.$username.'" login attempt'); my $ua = LWP::UserAgent->new; $ua->credentials('pause.perl.org:443', 'PAUSE', $username, $password); |