Skip to content

Instantly share code, notes, and snippets.

/stdout.txt Secret

Created September 18, 2014 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c109b87f27dacdd90a11 to your computer and use it in GitHub Desktop.
Save anonymous/c109b87f27dacdd90a11 to your computer and use it in GitHub Desktop.
iff --git a/src/hoodie/account.js b/src/hoodie/account.js
index 88a2fab..4d50828 100644
--- a/src/hoodie/account.js
+++ b/src/hoodie/account.js
@@ -144,7 +144,6 @@ function hoodieAccount(hoodie) {
return sendSignUpRequest(username, password)
.done(function(newUsername, newHoodieId, newBearerToken) {
setUsername(username);
- setBearerToken(newBearerToken);
account.trigger('signup', username);
});
};
@@ -225,7 +224,7 @@ function hoodieAccount(hoodie) {
function anonymousSignIn () {
var username = hoodie.id();
var password = getAnonymousPassword();
- return account.signIn(username, password).done( function() {
+ return account.signIn(username, password, {silent: true}).done( function() {
account.trigger('signin:anonymous', username);
});
}
@@ -277,7 +276,6 @@ function hoodieAccount(hoodie) {
if (!isReauthenticating && !options.moveData) {
cleanup();
}
- setBearerToken(newBearerToken);
if (isReauthenticating) {
if (!isSilent) {
account.trigger('reauthenticated', newUsername);
@@ -745,6 +743,7 @@ function hoodieAccount(hoodie) {
}
authenticated = true;
+ setBearerToken(newBearerToken);
account.fetch();
return resolveWith(newUsername, newHoodieId, newBearerToken, options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment