Skip to content

Commit

Permalink
fix auto signing bug for sandbox; update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Jun 23, 2015
1 parent efc1209 commit d9cc44e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
7 changes: 4 additions & 3 deletions examples/angularjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
<script>
function DemoCntl($scope, $location, $http, $q, $timeout) {
$scope.run = function() {
FamilySearch.init({
var fsClient = new FamilySearch({
client_id: 'YOUR_CLIENT_ID_GOES_HERE',
environment: 'sandbox',
redirect_uri: 'YOUR_REDIRECT_URI_GOES_HERE',
http_function: $http,
deferred_function: $q.defer,
timeout_function: $timeout,
save_access_token: true,
auto_expire: true
auto_expire: true,
auto_signin: true
});

FamilySearch.getCurrentUser().then(function(response) {
fsClient.getCurrentUser().then(function(response) {
// since the SDK is using AngularJS functions for http, deferred, and timeout, you don't have to call $scope.$apply!
$scope.contactName = response.getUser().contactName;
});
Expand Down
20 changes: 12 additions & 8 deletions examples/jquery-requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@
<body>
<script>
require(['FamilySearch'], function(FamilySearch) {
window.run = function() {
FamilySearch.getCurrentUser().then(function(response) {
$('#output').append('Hello '+response.getUser().contactName+'!');
});
};

FamilySearch.init({

var fsClient = new FamilySearch({
client_id: 'YOUR_CLIENT_ID_GOES_HERE',
environment: 'sandbox',
redirect_uri: 'YOUR_REDIRECT_URI_GOES_HERE',
http_function: $.ajax,
deferred_function: $.Deferred,
save_access_token: true,
auto_expire: true
auto_expire: true,
auto_signin: true
});

window.run = function() {
fsClient.getCurrentUser().then(function(response) {
$('#output').append('Hello '+response.getUser().contactName+'!');
});
};


});
</script>

Expand Down
19 changes: 11 additions & 8 deletions examples/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@

<body>
<script>
window.run = function() {
FamilySearch.getCurrentUser().then(function(response) {
$('#output').append('Hello '+response.getUser().contactName+'!');
});
};

FamilySearch.init({
var fsClient = new FamilySearch({
client_id: 'YOUR_CLIENT_ID_GOES_HERE',
environment: 'sandbox',
redirect_uri: 'YOUR_REDIRECT_URI_GOES_HERE',
http_function: $.ajax,
deferred_function: $.Deferred,
save_access_token: true,
auto_expire: true
auto_expire: true,
auto_signin: true
});

window.run = function() {
fsClient.getCurrentUser().then(function(response) {
$('#output').append('Hello '+response.getUser().contactName+'!');
});
};


</script>

<a href="#" onclick="run()">Run</a>
Expand Down
2 changes: 1 addition & 1 deletion src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
'production': 'https://familysearch.org'
},
oauthServer: {
'sandbox' : 'https://sandbox.familysearch.org/cis-web/oauth2/v3',
'sandbox' : 'https://integration.familysearch.org/cis-web/oauth2/v3',
'staging' : 'https://identbeta.familysearch.org/cis-web/oauth2/v3',
'beta' : 'https://identbeta.familysearch.org/cis-web/oauth2/v3',
'production': 'https://ident.familysearch.org/cis-web/oauth2/v3'
Expand Down

0 comments on commit d9cc44e

Please sign in to comment.