Name: angular-passwordless
Owner: Auth0
Description: null
Created: 2016-08-18 20:14:27.0
Updated: 2016-12-02 17:25:05.0
Pushed: 2017-02-21 15:50:47.0
Homepage: null
Size: 5
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This module provides a thin wrapper for version 10 of Auth0's Passwordless Lock widget.
Bower
r install angular-lock-passwordless
Ensure that both Auth0LockPasswordless and angular-lock-passwordless are loaded on the page.
ipt src="bower_components/auth0-lock-passwordless/build/lock-passwordless.min.js"></script>
ipt src="bower_components/angular-lock-passwordless/dist/angular-lock-passwordless.js"></script>
Bring in the auth0.lockPasswordless
module.
app = angular.module('myApp', ['auth0.lockPasswordless']);
Configure Auth0LockPasswordless by using lockPasswordlessProvider
. If you haven't done so yet, sign up for Auth0, create a client app, and get your clientID and domain. To learn more about Auth0LockPasswordless' API and the options it takes, see the API documentation and the list of customization options.
config(function(lockPasswordlessProvider) {
ckPasswordlessProvider.init({
clientID: AUTH0_CLIENT_ID,
domain: AUTH0_DOMAIN
;
Use lockPasswordless
in the run
block, in a service, or in a controller. For example, show the Auth0LockPasswordless widget from a controller and associated view.
controller('loginController', function(lockPasswordless) {
r vm = this;
.lockPasswordless = lockPasswordless;
tml
ng-controller="loginController as login">
utton ng-click="login.lock.emailcode()">Log In</button>
v>
Then, set up a listener for the authenticated
event.
run(function(lock) {
ck.on('authenticated', function(authResult) {
localStorage.setItem('id_token', authResult.idToken);
lock.getProfile(result.idToken, function(error, profile) {
if (error) {
console.log(error);
}
localStorage.setItem('profile', JSON.stringify(profile));
});
;
Auth0 helps you to:
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.