Created
September 19, 2014 00:22
-
-
Save jstrimpel/bca68962fab529851bb1 to your computer and use it in GitHub Desktop.
lazo model authentication fn
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