appirio-tech/ng-auth

Name: ng-auth

Owner: Topcoder

Description: ng-auth

Created: 2015-05-26 21:59:54.0

Updated: 2016-01-12 17:23:17.0

Pushed: 2017-01-16 05:07:53.0

Homepage:

Size: 1243

Language: CoffeeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ng-auth

GitHub version Build Status Coverage Status Dependency Status

Install
r install appirio-tech-ng-auth=git@github.com:appirio-tech/ng-auth --save
Usage
Include source
ipt src="/bower_components/appirio-tech-ng-auth/dist/main.js" type="text/javascript"></script>
Add dependency
 strict'

ndencies = [
ppirio-tech-ng-auth'


lar.module 'app', dependencies
Login via a controller
roller = -> ($scope, AuthService)
Success = ->
console.log 'log in successful'

Error = ->
console.log 'log in failed'

cope.login = ->
loginOptions =
  username: $scope.username
  password: $scope.password
  error: onError
  success: onSuccess

AuthService.login loginOptions
Check if user is logged in
ggedIn = AuthService.isLoggedIn
Get current user
roller = -> ($scope, UserV3Service)
 = this
ope.$watch UserV3Service.getCurrentUser, ->
user = UserV3Service.getCurrentUser()
vm.user = user if user

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.