<div dir="ltr">Tried it, It still goes into a redirect loop because the session is always undef the sub for "/".<div><br></div><div>:( I'd really appreciate anyone just peeing into this!</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Tue, Oct 1, 2013 at 4:48 AM, Slavik Goltser <span dir="ltr"><<a href="mailto:slavikg@gmail.com" target="_blank">slavikg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Doesn't that get ignored in Dancer2?<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 6:51 PM, Cymon <span dir="ltr"><<a href="mailto:cymon.ML@gmail.com" target="_blank">cymon.ML@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
i tried your code.<br>
<br>
Did you remember to add:<br>
<br>
register_plugin for_versions => [ 2 ];<br>
<br>
at the end of the plugin?<br>
It will not work without this.<br>
<br>
Cymon<br>
<a href="http://perlishscrewdriver.blogspot.it/" target="_blank">http://perlishscrewdriver.blogspot.it/</a><br>
<br>
Il giorno Sun, 29 Sep 2013 22:55:05 +0530<br>
"Gideon D'souza" <<a href="mailto:gidisrael@gmail.com" target="_blank">gidisrael@gmail.com</a>> ha scritto:<br>
<div><div><br>
> Thank you very much for your time.<br>
><br>
> I tried it. No luck still.<br>
><br>
> If I may bother you so:<br>
><br>
> on_plugin_import {<br>
>      my $dsl = shift;<br>
>      my $controller = sub { ...; ...; $dsl->session(user =><br>
> $some_json);} $dsl->any(['get'] => '/your/path', $controller);<br>
> }<br>
><br>
> in app that uses this plugin:<br>
><br>
> get '/' => sub {<br>
><br>
>       if (not defined(session->read('user'))) {<br>
> ######<br>
> #session->Read('user') is always undef!!!<br>
> ######<br>
>           return redirect auth_github_authenticate_url;<br>
>       }<br>
> };<br>
><br>
> Any clues here?<br>
><br>
><br>
> On Sun, Sep 29, 2013 at 6:49 PM, Cymon <<a href="mailto:cymon.ML@gmail.com" target="_blank">cymon.ML@gmail.com</a>> wrote:<br>
><br>
> ><br>
> > ><br>
> > > Is there a way to add routes inside a plugin, on init or something<br>
> > > like that? Or perhaps it's something else I've missed?<br>
> > ><br>
> > > Any reply or pointers appreciated.<br>
> ><br>
> > Hi,<br>
> > I have no time to try your code now and help you with your issue,<br>
> > but I can answer this.<br>
> ><br>
> > To add routes inside a plugin just define the on_plugin_import sub<br>
> > in your plugin package as this.<br>
> ><br>
> > on_plugin_import {<br>
> >      my $dsl = shift;<br>
> >      my $controller = sub { ...do things ... }<br>
> >      $dsl->any(['get'] => '/your/path', $controller);<br>
> > }<br>
> ><br>
> ><br>
> > --<br>
> > Cymon<br>
> > <a href="http://perlishscrewdriver.blogspot.it/" target="_blank">http://perlishscrewdriver.blogspot.it/</a><br>
> > _______________________________________________<br>
> > dancer-users mailing list<br>
> > <a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
> > <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
> ><br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Cymon<br>
Coniglio domina,<br>
<a href="http://www.therabbit.it" target="_blank">http://www.therabbit.it</a><br>
</font></span><div><div>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>