couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: Require login to see any data in a CouchApp?
Date Thu, 01 Apr 2010 00:56:24 GMT
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.

—ZZ

On Wed, Mar 31, 2010 at 1:41 PM, J Chris Anderson <jchris@gmail.com> 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!
>
>

Mime
View raw message