You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by wh...@aol.com on 2010/08/25 03:48:44 UTC
how to db.create() with a server admin
I want a user to signup for a couchdb database on my web page
I am using couch.js functions to do this and I can create a new database on the server.
If there is no server admins it works fine. Or if I am logged in as server admin it works fine.
But if I am logged out of futon it will not allow the user to create a db.
How can I do the couch.js db.create() if it requires a server admin account to do so?
I don't want to send my credentials with the request like http://dan:whimsica@localhost:5984 because
then someone could read that from the javascript.
I don't understand how you are supposed to do this.
I also can't be logged in all the time.
How can this work if the login:pass have to be in the javascript?
Dan
Re: how to db.create() with a server admin
Posted by Wout Mertens <wo...@gmail.com>.
You're trying to perform a privileged function as a normal user. You have two options:
1. Make all users admins
2. Create a cgi script on the server that verifies the parameters from the user and creates the db.
Wout.
On 25 Aug 2010, at 03:48, whimsica@aol.com wrote:
> I want a user to signup for a couchdb database on my web page
> I am using couch.js functions to do this and I can create a new database on the server.
>
> If there is no server admins it works fine. Or if I am logged in as server admin it works fine.
> But if I am logged out of futon it will not allow the user to create a db.
>
> How can I do the couch.js db.create() if it requires a server admin account to do so?
> I don't want to send my credentials with the request like http://dan:whimsica@localhost:5984 because
> then someone could read that from the javascript.
>
> I don't understand how you are supposed to do this.
> I also can't be logged in all the time.
>
> How can this work if the login:pass have to be in the javascript?
>
> Dan
>
>
>
>
>
>
>