mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-01-31 03:16:42 +01:00
Fixed null error while checking for admin
This commit is contained in:
parent
0c2b46dd20
commit
1ed0d54ab3
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
||||||
module.exports = angular.module('ponyfm').factory('auth', [
|
module.exports = angular.module('ponyfm').factory('auth', [
|
||||||
'$rootScope'
|
'$rootScope'
|
||||||
($rootScope) ->
|
($rootScope) ->
|
||||||
data: {isLogged: window.pfm.auth.isLogged, user: window.pfm.auth.user, isAdmin: window.pfm.auth.user.roles[0].id == 2}
|
data: {isLogged: window.pfm.auth.isLogged, user: window.pfm.auth.user, isAdmin: (window.pfm.auth.user.roles[0] && window.pfm.auth.user.roles[0].id == 2)}
|
||||||
login: (email, password, remember) ->
|
login: (email, password, remember) ->
|
||||||
def = new $.Deferred()
|
def = new $.Deferred()
|
||||||
$.post('/api/web/auth/login', {email: email, password: password, remember: remember})
|
$.post('/api/web/auth/login', {email: email, password: password, remember: remember})
|
||||||
|
|
Loading…
Reference in a new issue