Permalink
Browse files

Fix for OAuth CouchDB App

CouchDB OAuth app had a bug that was dependent upon console.log() being defined (like Chrome or Firebug creates.)

Signed-off-by: Jim Klo <jim.klo@sri.com>
  • Loading branch information...
1 parent a366db4 commit 74be7c90b15a8f108bb7b88596b9f2c6a905fb68 @jimklo jimklo committed Oct 3, 2012
View
@@ -7,7 +7,7 @@
setup(
name='LR',
- version='0.23.8',
+ version='0.23.9',
description='',
author='',
author_email='',

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -46,4 +46,6 @@ img {
float: right;
}
-.clear: both;
+.clear {
+ clear: both;
+}
@@ -3,6 +3,15 @@ var session = require("session"),
users = require("users"),
_ = require("underscore")._;
+function log(msg) {
+ try{
+ console.log(msg)
+ } catch (e) {
+
+ }
+}
+
+
function getOAuth(email, doc, regenerate) {
if (regenerate || !(doc.oauth
&& doc.oauth.consumer_keys
@@ -24,7 +33,7 @@ function getOAuth(email, doc, regenerate) {
users.update(email, null, doc, function(err) {
if (err) {
- console.log(err);
+ log(err);
} else {
getUserInfo(email);
}
@@ -78,7 +87,7 @@ function setSigningInfo() {
users.update(session_info.userCtx.name, null, doc, function(err) {
if (err) {
- console.log(err);
+ log(err);
setMessage("Unable to save signing information.");
} else {
setMessage("Information saved.")
@@ -150,7 +159,7 @@ function savePassword() {
users.update(session_info.userCtx.name, null, doc, function(err) {
if (err) {
- console.log(err);
+ log(err);
setMessage("Unable to save publish password.");
} else {
setMessage("Password saved.");
@@ -179,7 +188,7 @@ exports.registerCallbacks = function() {
}
if (email) {
- console.log(email);
+ log(email);
getUserInfo(email);
}
} catch (error) {

0 comments on commit 74be7c9

Please sign in to comment.