]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/postsignin_redirect_not_working.mdwn
Merge branch 'master' of ssh://git.ikiwiki.info
[ikiwiki.git] / doc / forum / postsignin_redirect_not_working.mdwn
1 I'm confused. I got a plugin working that allows a button to call up a login screen but I can't seem to get it to return to the calling page. I end up on the prefs page.
2
3 When the plugin first runs it puts the http_referer into a param:
4
5     $session->param("postsignin" => $ENV{HTTP_REFERER} );
6
7 Then when it runs for postsignin its supposed to pull it out and send the user to the original page:
8
9     my $page=$q->param("postsignin");
10     ...
11     IkiWiki::redirect($q, $page);
12     exit;
13
14 Full code is available on the plugin page: [[plugins/contrib/justlogin]].
15
16 I searched the site and there's very little info available for postsignin or redirect. Perhaps I'm using the wrong function?
17
18 > I don't know why you end up on the prefs page. Have you tried
19 > looking inside the session database to see what postsignin 
20 > parameter is stored?
21
22 > But, `cgi_postsignin()` assumes it can directly pass the postsignin cgi
23 > parameter into `cgi()`. You're expecting it to redirect to an url, and it
24 > just doesn't do that. Although I have considered adding a redirect 
25 > there, just so that openid login info doesn't appear in the url after
26 > signin (which breaks eg, reload). That would likely still not make your
27 > code work, since the value of postsignin is a url query string, not a
28 > full url.
29
30 > I'd suggest you put a do=goto redirect into postsignin. --[[Joey]]