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
val user : Box[User] = Empty | |
user = tryo(Users.getUser("chucknorris")) openOr Empty |
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
StackMobCommon.getStackMobInstance().forgotPassword("johndoe", new StackMobCallback() { | |
@Override public void success(String response) { | |
//forgotPassword succeeded | |
} | |
@Override public void failure(StackMobException e) { | |
//forgotPassword failed | |
} | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://static.stackmob.com/js/json2-min.js"></script> | |
<script type="text/javascript" src="http://static.stackmob.com/js/underscore-1.3.0-min.js"></script> | |
<script type="text/javascript" src="http://static.stackmob.com/js/backbone-0.5.3-min.js"></script> | |
<script type="text/javascript" src="http://static.stackmob.com/js/stackmob-js-0.1.1-min.js"></script> | |
<script type="text/javascript"> |
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
var users = new StackMob.Users(); | |
users.count(null, { | |
success: function(count) { | |
//count is an integer representing number of all users | |
} | |
}); |
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
/* | |
These instructions are for JS SDK Version 0.2.1 and below on how to add | |
custom user object with custom login/password fields. You have to let the | |
JS SDK know what your primary key and password field is, so we'll do that here. | |
*/ | |
//Let StackMob know what your username/pw fields are | |
StackMob.init({ | |
appName: ..., | |
clientSubdomain: ..., |
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
StackMob.User = StackMob.User.extend({ | |
forgotPassword : function(options) { | |
options = options || {}; | |
options['data'] = options['data'] || {}; | |
//fixed the following line. It used to be options['data'][StackMob.loginField] | |
options['data']['username'] = this.get(StackMob.loginField); | |
(this.sync || Backbone.sync).call(this, "forgotPassword", this, options); | |
} | |
}); |
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
/* | |
For chained functions, simply call the second, third, fourth functions in the "success" callbacks | |
Callbacks: http://www.stackmob.com/devcenter/docs/Javascript-SDK-API#a-success | |
These calls will execute in order 1 by 1, not simultaneously. | |
*/ | |
var user = new StackMob.User({ username: 'chucknorris', password: 'myfists' }); | |
user.login(false, { |
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
StackMob.init({ | |
appName: '', | |
clientSubdomain: '', | |
publicKey: '', | |
apiVersion: 0 | |
}); |
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
<?php | |
namespace Stackmob; | |
require_once("OAuth.php"); | |
/** | |
* Many thanks to jobiwankanobi@github and dancali@github for helping each other produce this StackMob OAuth 2.0 Signing PHP example. | |
* | |
* This code generates the value of the "Authorization" header to be passed on each request after a user signs in. | |
* The accessToken is returned from the OAuth 2.0 login request. | |
* |
OlderNewer