From a188aaa58f173090d07ca8000663fe0888ef9949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Kr=C3=B6ll?= Date: Mon, 1 Dec 2008 23:39:52 +0100 Subject: Take baseurl from config --- lib/PAUSE/OpenID/Controller/Root.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/PAUSE/OpenID/Controller/Root.pm b/lib/PAUSE/OpenID/Controller/Root.pm index 566a0a1..67d4411 100644 --- a/lib/PAUSE/OpenID/Controller/Root.pm +++ b/lib/PAUSE/OpenID/Controller/Root.pm @@ -31,14 +31,19 @@ PAUSE::OpenID::Controller::Root - Root Controller for PAUSE::OpenID sub index :Path :Args(0) { my ( $self, $c ) = @_; - if ( not defined $c->req->param('openid.return_to') ) { + # 5.2.3 + # If the malformed or invalid message is received by the Relying Party, or "openid.return_to" + # is not present or its value is not a valid URL, the server SHOULD return a response to the end user + # indicating the error and that it is unable to continue. + my $return_to = $c->req->param('openid.return_to'); + # TODO: check if its a valid URL + if ( not defined $return_to ) { #$c->flash->{xml} = 'Missing parameter'; $c->res->redirect($c->uri_for('/error')); } -$c->stash->{xml} =< -XML + # TODO: generate XML programatically + $c->stash->{xml} = sprintf('', $c->config->{'PAUSE::OpenID'}{'baseurl'}); # Pass through parameters (unchecked for now) foreach my $key ( keys %{$c->req->params} ) { -- cgit v1.2.3