Skip to content

zemirco/couchdb-browser-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm install and then grunt to start a local server.

CouchDB config

[httpd]
enable_cors = true

[cors]
credentials = true
origins = http://localhost:3000

[couch_httpd_auth]
require_valid_user = false

CouchDB view

You need a view in your database with validate_doc_update key.

{
  "_id": "_design/anything",
  "validate_doc_update":
  "function(newDoc, oldDoc, userCtx, secObj) {
    if(!userCtx.name) {
      throw({forbidden: 'Please login.'})
    }
  }"
}

About

CouchDB user authentication from the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published