Skip to content

Instantly share code, notes, and snippets.

@ptomasroos
Forked from jstrimpel/gist:bca68962fab529851bb1
Last active August 29, 2015 14:06
Show Gist options
  • Save ptomasroos/7161efe1037c36ebe657 to your computer and use it in GitHub Desktop.
Save ptomasroos/7161efe1037c36ebe657 to your computer and use it in GitHub Desktop.
// backs user model
define(['lazoSyncher'], function (LazoSyncher) {
return LazoSyncher.extend({
authenticate: function (credentials, options) {
// authenticate user using credentials
// you can call options.success or options.error
// update the user model, auth token, etc.
}
});
});
// in a controller that instantiated a user model
this.models.user.call('authenticate', {
success: function () {
// redirect user
},
error: function () {
// render authentication error in the UI
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment