-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only display delete option if track was added by current user
- Loading branch information
1 parent
6c18ad1
commit b89d9bd
Showing
8 changed files
with
101 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"use strict"; | ||
/** | ||
* Authentication service for google login | ||
* @module FM.auth.GoogleAuthService | ||
* @author SOON_ | ||
*/ | ||
angular.module("FM.auth.GoogleAuthService", [ | ||
"FM.api.UsersResource", | ||
"satellizer" | ||
]) | ||
/** | ||
* @class GoogleAuthService | ||
* @param {Service} $q | ||
* @param {Factory} UsersResource | ||
*/ | ||
.service("GoogleAuthService", [ | ||
"$rootScope", | ||
"$q", | ||
"$auth", | ||
"UsersResource", | ||
function ($rootScope, $q, $auth, UsersResource){ | ||
|
||
/** | ||
* @private | ||
* @property user | ||
* @type {Object} | ||
*/ | ||
var user = null; | ||
|
||
/** | ||
* @public | ||
* @method loadUser | ||
* @return {Promise} The current user object | ||
*/ | ||
this.loadUser = function loadUser() { | ||
var deferred = $q.defer(); | ||
|
||
UsersResource.current().$promise | ||
.then(function (response) { | ||
user = response; | ||
deferred.resolve(response); | ||
}) | ||
.catch(deferred.reject); | ||
|
||
return deferred.promise; | ||
}; | ||
|
||
/** | ||
* @public | ||
* @method getUser | ||
* @return {Object} The current user object | ||
*/ | ||
this.getUser = function getUser() { | ||
return user; | ||
}; | ||
|
||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters