Last active
August 29, 2015 14:27
-
-
Save sebastianrothbucher/98615d0aa09eca5674f6 to your computer and use it in GitHub Desktop.
Couch Login form (sep. public DB)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_id": "_design/login", | |
| "redir": "/somepath", | |
| "usage": "Deploy (i.e. add as doc - verbatim) to a DB that is public, call as /dbname/_design/login/_show/login?redir?/someredirpath (where the query param is optional and falls back to 'redir' in the design doc. Advantage: Browsers (esp. iPhone) can remember credentials", | |
| "shows": { | |
| "login": "function(doc, req){return \"<html><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\" /></head><body><form action=\\\"/_session?next=\"+(req.query.redir?req.query.redir:this.redir)+\"\\\" method=\\\"POST\\\">User: <input type=\\\"text\\\" name=\\\"name\\\" /><br />Pass: <input type=\\\"password\\\" name=\\\"password\\\" /><br /><input type=\\\"submit\\\" /></form></body></html>\"}" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment