Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 73755 invoked from network); 1 Apr 2010 00:57:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 00:57:14 -0000 Received: (qmail 6133 invoked by uid 500); 1 Apr 2010 00:57:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 6094 invoked by uid 500); 1 Apr 2010 00:57:13 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 6086 invoked by uid 99); 1 Apr 2010 00:57:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 00:57:13 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zachary.zolton@gmail.com designates 74.125.82.52 as permitted sender) Received: from [74.125.82.52] (HELO mail-ww0-f52.google.com) (74.125.82.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 00:57:05 +0000 Received: by wwd20 with SMTP id 20so427157wwd.11 for ; Wed, 31 Mar 2010 17:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type :content-transfer-encoding; bh=InqBNqpTI0rRrAphLFd4AoHbNT5C32+6rc5zurevAUI=; b=r6uvlhubeoWhuPUKhk61LXc9OSp2OqLbLfraLXiuPG10EQwHRaHYC5zefi4GKwVgw2 e9/eXjnQia+GOvjiUmY8zxDrr+b3x0mp+3cptVbRUog0rE/NS4EaLT8sc+P0wNVC0Hxn Xkm+1ZWJa590v/ieQQu2J6MvVWS1v8n6GuSlc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jXl2c0rhD5wTkXS8FzKiBgSfP/oQlxyTquMIJuOJueGwgUADiuxaiBM3Rz4qqXfaMJ GSFv6r8GCsdQURQzT+B0AD1pymS3bfIbC8fch0zhOG3zsHxtKc2dS5Y2X4L7sDVBvjy0 amdPRvLD4Jjtgs+uhHa2WVNHSnbm2Ojhd9mvk= MIME-Version: 1.0 Received: by 10.216.159.1 with HTTP; Wed, 31 Mar 2010 17:56:24 -0700 (PDT) In-Reply-To: References: From: Zachary Zolton Date: Wed, 31 Mar 2010 19:56:24 -0500 Received: by 10.216.87.134 with SMTP id y6mr52048wee.20.1270083404772; Wed, 31 Mar 2010 17:56:44 -0700 (PDT) Message-ID: Subject: Re: Require login to see any data in a CouchApp? To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org That's fair, I'll make a separate login DB+app. Is there some way I can replace that "unauthorized error" JSON response with a redirect to my login page? Given that the auth cookie times out, I'll need to send users back to login screen occassionally. If not, perhaps this would be a useful feature. =97ZZ On Wed, Mar 31, 2010 at 1:41 PM, J Chris Anderson wrote: > > On Mar 31, 2010, at 11:34 AM, Zachary Zolton wrote: > >> Howdy, >> >> So, I'm building a CouchApp where I want only logged in users to be >> able to see any data. My problem is that if I add a role to the reader >> list in the DB security object, the user can't see my login page >> (which is just an HTML attachment on my ddoc), since any requests on >> that database result in a unauthorized error. >> >> Two workarounds: >> >> 1) have an app-layer middle layer (i.e. Sinatra, Node.JS, PHP, etc) to >> which I say "boo" >> >> 2) have a second database + couchapp (without readers restriction) to >> handle the login page, but that sounds like too much hassle >> > > #2 is the only way I can think of. > > Users's won't know that the login screen is hosted from a public db. They= just follow links. > >> Any better ideas? >> >> >> Cheers, >> >> Zach >> >> P.S. will release to github soon! > >