Skip to content

Instantly share code, notes, and snippets.

@gr2m
Last active May 7, 2022 08:22
Show Gist options
  • Select an option

  • Save gr2m/5463426 to your computer and use it in GitHub Desktop.

Select an option

Save gr2m/5463426 to your computer and use it in GitHub Desktop.

Revisions

  1. gr2m revised this gist May 11, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion account_dreamcode.js
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ account.signUp({
    // that changeUsername or changePassword would simply
    // be shortcuts for
    account.change({
    birthday: '1984-05-09','
    birthday: '1984-05-09',
    });
    account.change({
    username: 'joe3000',
  2. gr2m revised this gist May 11, 2013. 1 changed file with 21 additions and 1 deletion.
    22 changes: 21 additions & 1 deletion account_dreamcode.js
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,24 @@ account.changeUsername('currentpassword', 'newusername');
    account.resetPassword('joe@example.com');

    // destroy account and all its data
    account.destroy('currentpassword');
    account.destroy('currentpassword');

    // all methods could alternatively accept a parameter hash
    // that would also allow for additional user info
    account.signUp({
    username: 'joe2000',
    password: 'secret',
    birthday: '1984-05-09',
    email: 'joe@example.com'
    });

    // that would also allow for a general change method,
    // that changeUsername or changePassword would simply
    // be shortcuts for
    account.change({
    birthday: '1984-05-09','
    });
    account.change({
    username: 'joe3000',
    password: 'secret'
    });
  3. gr2m revised this gist May 11, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion account_dreamcode.js
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,4 @@ account.changeUsername('currentpassword', 'newusername');
    account.resetPassword('joe@example.com');

    // destroy account and all its data
    account.destroy();
    account.destroy('currentpassword');
  4. gr2m created this gist Apr 25, 2013.
    23 changes: 23 additions & 0 deletions account_dreamcode.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    // sign up
    account.signUp('joe@example.com', 'secret');

    // sign in
    account.signIn('joe@example.com', 'secret');

    // sign in via oauth
    account.signInWith('twitter');

    // sign out
    account.signOut();

    // change password
    account.changePassword('currentpassword', 'newpassword');

    // change username
    account.changeUsername('currentpassword', 'newusername');

    // reset password
    account.resetPassword('joe@example.com');

    // destroy account and all its data
    account.destroy();