-
-
Save ptomasroos/7161efe1037c36ebe657 to your computer and use it in GitHub Desktop.
This file contains 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
// 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