Skip to content

Instantly share code, notes, and snippets.

@taliwalt
Created January 5, 2016 22:38
Show Gist options
  • Save taliwalt/11bdb60bc710c9bc9372 to your computer and use it in GitHub Desktop.
Save taliwalt/11bdb60bc710c9bc9372 to your computer and use it in GitHub Desktop.
//In order to link two accounts, create a link method in a controller (make sure to have the auth object injected):
$scope.link = function () {
auth.auth0js._callbackOnLocationHash = true;
auth.signin({
authParams: {
access_token: auth.accessToken
}
}, function (profile, token) {
// TODO Handle accounts linked
console.log('linked');
}, function () {
// TODO Handle error
}, 'Auth0');
};
//Then, create an anchor in your view:
<a ng-click="link()">link account</a>
//When the user clicks on that anchor, they will be prompted to enter the credentials for the account they want to link.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment