Received: by 10.204.154.76 with SMTP id n12mr2017263bkw.1.1343645321355; Mon, 30 Jul 2012 03:48:41 -0700 (PDT) X-BeenThere: mojolicious@googlegroups.com Received: by 10.205.119.129 with SMTP id fu1ls4571815bkc.4.gmail; Mon, 30 Jul 2012 03:48:39 -0700 (PDT) Received: by 10.204.130.7 with SMTP id q7mr2017146bks.2.1343645319243; Mon, 30 Jul 2012 03:48:39 -0700 (PDT) Received: by 10.204.130.7 with SMTP id q7mr2017145bks.2.1343645319229; Mon, 30 Jul 2012 03:48:39 -0700 (PDT) Return-Path: Received: from snt0-omc1-s29.snt0.hotmail.com (snt0-omc1-s29.snt0.hotmail.com. [65.55.90.40]) by gmr-mx.google.com with ESMTP id q3si2860588bkv.1.2012.07.30.03.48.38; Mon, 30 Jul 2012 03:48:39 -0700 (PDT) Received-SPF: pass (google.com: domain of byter...@hotmail.com designates 65.55.90.40 as permitted sender) client-ip=65.55.90.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of byter...@hotmail.com designates 65.55.90.40 as permitted sender) smtp.mail=byter...@hotmail.com Received: from SNT134-W21 ([65.55.90.8]) by snt0-omc1-s29.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 30 Jul 2012 03:48:38 -0700 Message-ID: Return-Path: byter...@hotmail.com X-Originating-IP: [216.191.234.70] From: John Scoles To: Subject: RE: [Mojolicious] Authenticating Routes Date: Mon, 30 Jul 2012 06:48:37 -0400 Importance: Normal In-Reply-To: References: <31610ff6-6870-48ab-b90d-1c8e6782a096@googlegroups.com> ,, Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 30 Jul 2012 10:48:38.0388 (UTC) FILETIME=[E04F7B40:01CD6E40] that won't realy work on a bridge as a bridge just goes to the controller i= t is not condtional route try this in you check sub check { my $self =3D shift=3B $self->redirect_to('not_authn') and return 0 unless($self->is_user_authen= ticated)=3B return 1=3B } where not_authn is a template or named route that you want your user to go = to when they are not authenticated A condtionaly controller works like this $r->route('/home')->over(authenticated =3D> 1)->to('example#home')->name('h= ome')=3B however what you want(catch all) is what you have now with the small change= above Cheers John ________________________________ > Date: Mon=2C 30 Jul 2012 03:37:07 -0700=20 > From: am...@rae-consulting.com=20 > To: mojolicious@googlegroups.com=20 > Subject: Re: [Mojolicious] Authenticating Routes=20 >=20 > Thanks David for the info. Following is the code inside check:=20 >=20 > sub check {=20 > my $self =3D shift=3B=20 > return 0 unless($self->is_user_authenticated)=3B=20 > return 1=3B=20 > }=20 >=20 > On Monday=2C July 30=2C 2012 1:26:51 PM UTC+5:30=2C David Oswald wrote:=20 > > 'main'=2C Main::check=2C main::check=2C Main::check=2C=20 > > main::check code (pay attention to capitalization).=20 >=20 > You see=2C even after talking about it=2C I still am getting it mixed up.= =20 > 'main' vs 'Main'. ...that controller name is begging to be changed to=20 > something that doesn't resemble Perl's default package. =3B)=20 >=20 >=20 > --=20 >=20 > David Oswald=20 >=20 >=20 > --=20 > You received this message because you are subscribed to the Google=20 > Groups "Mojolicious" group.=20 > To view this discussion on the web visit=20 > https://groups.google.com/d/msg/mojolicious/-/_uy0fIj3haIJ.=20 > To post to this group=2C send email to mojolicious@googlegroups.com.=20 > To unsubscribe from this group=2C send email to=20 > mojolicious+unsubscribe@googlegroups.com.=20 > For more options=2C visit this group at=20 > http://groups.google.com/group/mojolicious?hl=3Den. =