auth0/angular-passwordless

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Auth0 Passwordless Lock 10 for Angular 1.x

This module provides a thin wrapper for version 10 of Auth0's Passwordless Lock widget.

Installation

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>


Usage

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));
});
;

What is Auth0?

Auth0 helps you to:

Create a free account in Auth0
  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.
Issue Reporting

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.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.